//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2021 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto/tree/main/CodeGenerator. DO NOT EDIT.

import Foundation
import SotoCore

extension AutoScaling {
    // MARK: Enums

    public enum InstanceMetadataEndpointState: String, CustomStringConvertible, Codable {
        case disabled
        case enabled
        public var description: String { return self.rawValue }
    }

    public enum InstanceMetadataHttpTokensState: String, CustomStringConvertible, Codable {
        case optional
        case required
        public var description: String { return self.rawValue }
    }

    public enum InstanceRefreshStatus: String, CustomStringConvertible, Codable {
        case cancelled = "Cancelled"
        case cancelling = "Cancelling"
        case failed = "Failed"
        case inprogress = "InProgress"
        case pending = "Pending"
        case successful = "Successful"
        public var description: String { return self.rawValue }
    }

    public enum LifecycleState: String, CustomStringConvertible, Codable {
        case detached = "Detached"
        case detaching = "Detaching"
        case enteringstandby = "EnteringStandby"
        case inservice = "InService"
        case pending = "Pending"
        case pendingProceed = "Pending:Proceed"
        case pendingWait = "Pending:Wait"
        case quarantined = "Quarantined"
        case standby = "Standby"
        case terminated = "Terminated"
        case terminating = "Terminating"
        case terminatingProceed = "Terminating:Proceed"
        case terminatingWait = "Terminating:Wait"
        public var description: String { return self.rawValue }
    }

    public enum MetricStatistic: String, CustomStringConvertible, Codable {
        case average = "Average"
        case maximum = "Maximum"
        case minimum = "Minimum"
        case samplecount = "SampleCount"
        case sum = "Sum"
        public var description: String { return self.rawValue }
    }

    public enum MetricType: String, CustomStringConvertible, Codable {
        case albrequestcountpertarget = "ALBRequestCountPerTarget"
        case asgaveragecpuutilization = "ASGAverageCPUUtilization"
        case asgaveragenetworkin = "ASGAverageNetworkIn"
        case asgaveragenetworkout = "ASGAverageNetworkOut"
        public var description: String { return self.rawValue }
    }

    public enum RefreshStrategy: String, CustomStringConvertible, Codable {
        case rolling = "Rolling"
        public var description: String { return self.rawValue }
    }

    public enum ScalingActivityStatusCode: String, CustomStringConvertible, Codable {
        case cancelled = "Cancelled"
        case failed = "Failed"
        case inprogress = "InProgress"
        case midlifecycleaction = "MidLifecycleAction"
        case pendingspotbidplacement = "PendingSpotBidPlacement"
        case preinservice = "PreInService"
        case successful = "Successful"
        case waitingforelbconnectiondraining = "WaitingForELBConnectionDraining"
        case waitingforinstanceid = "WaitingForInstanceId"
        case waitingforinstancewarmup = "WaitingForInstanceWarmup"
        case waitingforspotinstanceid = "WaitingForSpotInstanceId"
        case waitingforspotinstancerequestid = "WaitingForSpotInstanceRequestId"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct ActivitiesType: AWSDecodableShape {
        /// The scaling activities. Activities are sorted by start time. Activities still in progress are described first.
        @CustomCoding<StandardArrayCoder>
        public var activities: [Activity]
        /// A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.
        public let nextToken: String?

        public init(activities: [Activity], nextToken: String? = nil) {
            self.activities = activities
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case activities = "Activities"
            case nextToken = "NextToken"
        }
    }

    public struct Activity: AWSDecodableShape {
        /// The ID of the activity.
        public let activityId: String
        /// The Amazon Resource Name (ARN) of the Auto Scaling group.
        public let autoScalingGroupARN: String?
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The state of the Auto Scaling group, which is either InService or Deleted.
        public let autoScalingGroupState: String?
        /// The reason the activity began.
        public let cause: String
        /// A friendly, more verbose description of the activity.
        public let description: String?
        /// The details about the activity.
        public let details: String?
        /// The end time of the activity.
        public let endTime: Date?
        /// A value between 0 and 100 that indicates the progress of the activity.
        public let progress: Int?
        /// The start time of the activity.
        public let startTime: Date
        /// The current status of the activity.
        public let statusCode: ScalingActivityStatusCode
        /// A friendly, more verbose description of the activity status.
        public let statusMessage: String?

        public init(activityId: String, autoScalingGroupARN: String? = nil, autoScalingGroupName: String, autoScalingGroupState: String? = nil, cause: String, description: String? = nil, details: String? = nil, endTime: Date? = nil, progress: Int? = nil, startTime: Date, statusCode: ScalingActivityStatusCode, statusMessage: String? = nil) {
            self.activityId = activityId
            self.autoScalingGroupARN = autoScalingGroupARN
            self.autoScalingGroupName = autoScalingGroupName
            self.autoScalingGroupState = autoScalingGroupState
            self.cause = cause
            self.description = description
            self.details = details
            self.endTime = endTime
            self.progress = progress
            self.startTime = startTime
            self.statusCode = statusCode
            self.statusMessage = statusMessage
        }

        private enum CodingKeys: String, CodingKey {
            case activityId = "ActivityId"
            case autoScalingGroupARN = "AutoScalingGroupARN"
            case autoScalingGroupName = "AutoScalingGroupName"
            case autoScalingGroupState = "AutoScalingGroupState"
            case cause = "Cause"
            case description = "Description"
            case details = "Details"
            case endTime = "EndTime"
            case progress = "Progress"
            case startTime = "StartTime"
            case statusCode = "StatusCode"
            case statusMessage = "StatusMessage"
        }
    }

    public struct ActivityType: AWSDecodableShape {
        /// A scaling activity.
        public let activity: Activity?

        public init(activity: Activity? = nil) {
            self.activity = activity
        }

        private enum CodingKeys: String, CodingKey {
            case activity = "Activity"
        }
    }

    public struct AdjustmentType: AWSDecodableShape {
        /// The policy adjustment type. The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
        public let adjustmentType: String?

        public init(adjustmentType: String? = nil) {
            self.adjustmentType = adjustmentType
        }

        private enum CodingKeys: String, CodingKey {
            case adjustmentType = "AdjustmentType"
        }
    }

    public struct Alarm: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the alarm.
        public let alarmARN: String?
        /// The name of the alarm.
        public let alarmName: String?

        public init(alarmARN: String? = nil, alarmName: String? = nil) {
            self.alarmARN = alarmARN
            self.alarmName = alarmName
        }

        private enum CodingKeys: String, CodingKey {
            case alarmARN = "AlarmARN"
            case alarmName = "AlarmName"
        }
    }

    public struct AttachInstancesQuery: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The IDs of the instances. You can specify up to 20 instances.
        @OptionalCustomCoding<StandardArrayCoder>
        public var instanceIds: [String]?

        public init(autoScalingGroupName: String, instanceIds: [String]? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.instanceIds = instanceIds
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.instanceIds?.forEach {
                try validate($0, name: "instanceIds[]", parent: name, max: 19)
                try validate($0, name: "instanceIds[]", parent: name, min: 1)
                try validate($0, name: "instanceIds[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case instanceIds = "InstanceIds"
        }
    }

    public struct AttachLoadBalancerTargetGroupsResultType: AWSDecodableShape {
        public init() {}
    }

    public struct AttachLoadBalancerTargetGroupsType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The Amazon Resource Names (ARN) of the target groups. You can specify up to 10 target groups. To get the ARN of a target group, use the Elastic Load Balancing DescribeTargetGroups API operation.
        @CustomCoding<StandardArrayCoder>
        public var targetGroupARNs: [String]

        public init(autoScalingGroupName: String, targetGroupARNs: [String]) {
            self.autoScalingGroupName = autoScalingGroupName
            self.targetGroupARNs = targetGroupARNs
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.targetGroupARNs.forEach {
                try validate($0, name: "targetGroupARNs[]", parent: name, max: 511)
                try validate($0, name: "targetGroupARNs[]", parent: name, min: 1)
                try validate($0, name: "targetGroupARNs[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case targetGroupARNs = "TargetGroupARNs"
        }
    }

    public struct AttachLoadBalancersResultType: AWSDecodableShape {
        public init() {}
    }

    public struct AttachLoadBalancersType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The names of the load balancers. You can specify up to 10 load balancers.
        @CustomCoding<StandardArrayCoder>
        public var loadBalancerNames: [String]

        public init(autoScalingGroupName: String, loadBalancerNames: [String]) {
            self.autoScalingGroupName = autoScalingGroupName
            self.loadBalancerNames = loadBalancerNames
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.loadBalancerNames.forEach {
                try validate($0, name: "loadBalancerNames[]", parent: name, max: 255)
                try validate($0, name: "loadBalancerNames[]", parent: name, min: 1)
                try validate($0, name: "loadBalancerNames[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case loadBalancerNames = "LoadBalancerNames"
        }
    }

    public struct AutoScalingGroup: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the Auto Scaling group.
        public let autoScalingGroupARN: String?
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// One or more Availability Zones for the group.
        @CustomCoding<StandardArrayCoder>
        public var availabilityZones: [String]
        /// Indicates whether Capacity Rebalancing is enabled.
        public let capacityRebalance: Bool?
        /// The date and time the group was created.
        public let createdTime: Date
        /// The duration of the default cooldown period, in seconds.
        public let defaultCooldown: Int
        /// The desired size of the group.
        public let desiredCapacity: Int
        /// The metrics enabled for the group.
        @OptionalCustomCoding<StandardArrayCoder>
        public var enabledMetrics: [EnabledMetric]?
        /// The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service.
        public let healthCheckGracePeriod: Int?
        /// The service to use for the health checks. The valid values are EC2 and ELB. If you configure an Auto Scaling group to use ELB health checks, it considers the instance unhealthy if it fails either the EC2 status checks or the load balancer health checks.
        public let healthCheckType: String
        /// The EC2 instances associated with the group.
        @OptionalCustomCoding<StandardArrayCoder>
        public var instances: [Instance]?
        /// The name of the associated launch configuration.
        public let launchConfigurationName: String?
        /// The launch template for the group.
        public let launchTemplate: LaunchTemplateSpecification?
        /// One or more load balancers associated with the group.
        @OptionalCustomCoding<StandardArrayCoder>
        public var loadBalancerNames: [String]?
        /// The maximum amount of time, in seconds, that an instance can be in service. Valid Range: Minimum value of 0.
        public let maxInstanceLifetime: Int?
        /// The maximum size of the group.
        public let maxSize: Int
        /// The minimum size of the group.
        public let minSize: Int
        /// The mixed instances policy for the group.
        public let mixedInstancesPolicy: MixedInstancesPolicy?
        /// Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in.
        public let newInstancesProtectedFromScaleIn: Bool?
        /// The name of the placement group into which to launch your instances, if any.
        public let placementGroup: String?
        /// The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS services on your behalf.
        public let serviceLinkedRoleARN: String?
        /// The current state of the group when the DeleteAutoScalingGroup operation is in progress.
        public let status: String?
        /// The suspended processes associated with the group.
        @OptionalCustomCoding<StandardArrayCoder>
        public var suspendedProcesses: [SuspendedProcess]?
        /// The tags for the group.
        @OptionalCustomCoding<StandardArrayCoder>
        public var tags: [TagDescription]?
        /// The Amazon Resource Names (ARN) of the target groups for your load balancer.
        @OptionalCustomCoding<StandardArrayCoder>
        public var targetGroupARNs: [String]?
        /// The termination policies for the group.
        @OptionalCustomCoding<StandardArrayCoder>
        public var terminationPolicies: [String]?
        /// One or more subnet IDs, if applicable, separated by commas.
        public let vPCZoneIdentifier: String?

        public init(autoScalingGroupARN: String? = nil, autoScalingGroupName: String, availabilityZones: [String], capacityRebalance: Bool? = nil, createdTime: Date, defaultCooldown: Int, desiredCapacity: Int, enabledMetrics: [EnabledMetric]? = nil, healthCheckGracePeriod: Int? = nil, healthCheckType: String, instances: [Instance]? = nil, launchConfigurationName: String? = nil, launchTemplate: LaunchTemplateSpecification? = nil, loadBalancerNames: [String]? = nil, maxInstanceLifetime: Int? = nil, maxSize: Int, minSize: Int, mixedInstancesPolicy: MixedInstancesPolicy? = nil, newInstancesProtectedFromScaleIn: Bool? = nil, placementGroup: String? = nil, serviceLinkedRoleARN: String? = nil, status: String? = nil, suspendedProcesses: [SuspendedProcess]? = nil, tags: [TagDescription]? = nil, targetGroupARNs: [String]? = nil, terminationPolicies: [String]? = nil, vPCZoneIdentifier: String? = nil) {
            self.autoScalingGroupARN = autoScalingGroupARN
            self.autoScalingGroupName = autoScalingGroupName
            self.availabilityZones = availabilityZones
            self.capacityRebalance = capacityRebalance
            self.createdTime = createdTime
            self.defaultCooldown = defaultCooldown
            self.desiredCapacity = desiredCapacity
            self.enabledMetrics = enabledMetrics
            self.healthCheckGracePeriod = healthCheckGracePeriod
            self.healthCheckType = healthCheckType
            self.instances = instances
            self.launchConfigurationName = launchConfigurationName
            self.launchTemplate = launchTemplate
            self.loadBalancerNames = loadBalancerNames
            self.maxInstanceLifetime = maxInstanceLifetime
            self.maxSize = maxSize
            self.minSize = minSize
            self.mixedInstancesPolicy = mixedInstancesPolicy
            self.newInstancesProtectedFromScaleIn = newInstancesProtectedFromScaleIn
            self.placementGroup = placementGroup
            self.serviceLinkedRoleARN = serviceLinkedRoleARN
            self.status = status
            self.suspendedProcesses = suspendedProcesses
            self.tags = tags
            self.targetGroupARNs = targetGroupARNs
            self.terminationPolicies = terminationPolicies
            self.vPCZoneIdentifier = vPCZoneIdentifier
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupARN = "AutoScalingGroupARN"
            case autoScalingGroupName = "AutoScalingGroupName"
            case availabilityZones = "AvailabilityZones"
            case capacityRebalance = "CapacityRebalance"
            case createdTime = "CreatedTime"
            case defaultCooldown = "DefaultCooldown"
            case desiredCapacity = "DesiredCapacity"
            case enabledMetrics = "EnabledMetrics"
            case healthCheckGracePeriod = "HealthCheckGracePeriod"
            case healthCheckType = "HealthCheckType"
            case instances = "Instances"
            case launchConfigurationName = "LaunchConfigurationName"
            case launchTemplate = "LaunchTemplate"
            case loadBalancerNames = "LoadBalancerNames"
            case maxInstanceLifetime = "MaxInstanceLifetime"
            case maxSize = "MaxSize"
            case minSize = "MinSize"
            case mixedInstancesPolicy = "MixedInstancesPolicy"
            case newInstancesProtectedFromScaleIn = "NewInstancesProtectedFromScaleIn"
            case placementGroup = "PlacementGroup"
            case serviceLinkedRoleARN = "ServiceLinkedRoleARN"
            case status = "Status"
            case suspendedProcesses = "SuspendedProcesses"
            case tags = "Tags"
            case targetGroupARNs = "TargetGroupARNs"
            case terminationPolicies = "TerminationPolicies"
            case vPCZoneIdentifier = "VPCZoneIdentifier"
        }
    }

    public struct AutoScalingGroupNamesType: AWSEncodableShape {
        /// The names of the Auto Scaling groups. By default, you can only specify up to 50 names. You can optionally increase this limit using the MaxRecords parameter. If you omit this parameter, all Auto Scaling groups are described.
        @OptionalCustomCoding<StandardArrayCoder>
        public var autoScalingGroupNames: [String]?
        /// The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.
        public let maxRecords: Int?
        /// The token for the next set of items to return. (You received this token from a previous call.)
        public let nextToken: String?

        public init(autoScalingGroupNames: [String]? = nil, maxRecords: Int? = nil, nextToken: String? = nil) {
            self.autoScalingGroupNames = autoScalingGroupNames
            self.maxRecords = maxRecords
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.autoScalingGroupNames?.forEach {
                try validate($0, name: "autoScalingGroupNames[]", parent: name, max: 255)
                try validate($0, name: "autoScalingGroupNames[]", parent: name, min: 1)
                try validate($0, name: "autoScalingGroupNames[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupNames = "AutoScalingGroupNames"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
        }
    }

    public struct AutoScalingGroupsType: AWSDecodableShape {
        /// The groups.
        @CustomCoding<StandardArrayCoder>
        public var autoScalingGroups: [AutoScalingGroup]
        /// A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.
        public let nextToken: String?

        public init(autoScalingGroups: [AutoScalingGroup], nextToken: String? = nil) {
            self.autoScalingGroups = autoScalingGroups
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroups = "AutoScalingGroups"
            case nextToken = "NextToken"
        }
    }

    public struct AutoScalingInstanceDetails: AWSDecodableShape {
        /// The name of the Auto Scaling group for the instance.
        public let autoScalingGroupName: String
        /// The Availability Zone for the instance.
        public let availabilityZone: String
        /// The last reported health status of this instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy and Amazon EC2 Auto Scaling should terminate and replace it.
        public let healthStatus: String
        /// The ID of the instance.
        public let instanceId: String
        /// The instance type of the EC2 instance.
        public let instanceType: String?
        /// The launch configuration used to launch the instance. This value is not available if you attached the instance to the Auto Scaling group.
        public let launchConfigurationName: String?
        /// The launch template for the instance.
        public let launchTemplate: LaunchTemplateSpecification?
        /// The lifecycle state for the instance. The Quarantined state is not used. For information about lifecycle states, see Instance lifecycle in the Amazon EC2 Auto Scaling User Guide.  Valid Values: Pending | Pending:Wait | Pending:Proceed | Quarantined | InService | Terminating | Terminating:Wait | Terminating:Proceed | Terminated | Detaching | Detached | EnteringStandby | Standby
        public let lifecycleState: String
        /// Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in.
        public let protectedFromScaleIn: Bool
        /// The number of capacity units contributed by the instance based on its instance type. Valid Range: Minimum value of 1. Maximum value of 999.
        public let weightedCapacity: String?

        public init(autoScalingGroupName: String, availabilityZone: String, healthStatus: String, instanceId: String, instanceType: String? = nil, launchConfigurationName: String? = nil, launchTemplate: LaunchTemplateSpecification? = nil, lifecycleState: String, protectedFromScaleIn: Bool, weightedCapacity: String? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.availabilityZone = availabilityZone
            self.healthStatus = healthStatus
            self.instanceId = instanceId
            self.instanceType = instanceType
            self.launchConfigurationName = launchConfigurationName
            self.launchTemplate = launchTemplate
            self.lifecycleState = lifecycleState
            self.protectedFromScaleIn = protectedFromScaleIn
            self.weightedCapacity = weightedCapacity
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case availabilityZone = "AvailabilityZone"
            case healthStatus = "HealthStatus"
            case instanceId = "InstanceId"
            case instanceType = "InstanceType"
            case launchConfigurationName = "LaunchConfigurationName"
            case launchTemplate = "LaunchTemplate"
            case lifecycleState = "LifecycleState"
            case protectedFromScaleIn = "ProtectedFromScaleIn"
            case weightedCapacity = "WeightedCapacity"
        }
    }

    public struct AutoScalingInstancesType: AWSDecodableShape {
        /// The instances.
        @OptionalCustomCoding<StandardArrayCoder>
        public var autoScalingInstances: [AutoScalingInstanceDetails]?
        /// A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.
        public let nextToken: String?

        public init(autoScalingInstances: [AutoScalingInstanceDetails]? = nil, nextToken: String? = nil) {
            self.autoScalingInstances = autoScalingInstances
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingInstances = "AutoScalingInstances"
            case nextToken = "NextToken"
        }
    }

    public struct BatchDeleteScheduledActionAnswer: AWSDecodableShape {
        /// The names of the scheduled actions that could not be deleted, including an error message.
        @OptionalCustomCoding<StandardArrayCoder>
        public var failedScheduledActions: [FailedScheduledUpdateGroupActionRequest]?

        public init(failedScheduledActions: [FailedScheduledUpdateGroupActionRequest]? = nil) {
            self.failedScheduledActions = failedScheduledActions
        }

        private enum CodingKeys: String, CodingKey {
            case failedScheduledActions = "FailedScheduledActions"
        }
    }

    public struct BatchDeleteScheduledActionType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The names of the scheduled actions to delete. The maximum number allowed is 50.
        @CustomCoding<StandardArrayCoder>
        public var scheduledActionNames: [String]

        public init(autoScalingGroupName: String, scheduledActionNames: [String]) {
            self.autoScalingGroupName = autoScalingGroupName
            self.scheduledActionNames = scheduledActionNames
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.scheduledActionNames.forEach {
                try validate($0, name: "scheduledActionNames[]", parent: name, max: 255)
                try validate($0, name: "scheduledActionNames[]", parent: name, min: 1)
                try validate($0, name: "scheduledActionNames[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case scheduledActionNames = "ScheduledActionNames"
        }
    }

    public struct BatchPutScheduledUpdateGroupActionAnswer: AWSDecodableShape {
        /// The names of the scheduled actions that could not be created or updated, including an error message.
        @OptionalCustomCoding<StandardArrayCoder>
        public var failedScheduledUpdateGroupActions: [FailedScheduledUpdateGroupActionRequest]?

        public init(failedScheduledUpdateGroupActions: [FailedScheduledUpdateGroupActionRequest]? = nil) {
            self.failedScheduledUpdateGroupActions = failedScheduledUpdateGroupActions
        }

        private enum CodingKeys: String, CodingKey {
            case failedScheduledUpdateGroupActions = "FailedScheduledUpdateGroupActions"
        }
    }

    public struct BatchPutScheduledUpdateGroupActionType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// One or more scheduled actions. The maximum number allowed is 50.
        @CustomCoding<StandardArrayCoder>
        public var scheduledUpdateGroupActions: [ScheduledUpdateGroupActionRequest]

        public init(autoScalingGroupName: String, scheduledUpdateGroupActions: [ScheduledUpdateGroupActionRequest]) {
            self.autoScalingGroupName = autoScalingGroupName
            self.scheduledUpdateGroupActions = scheduledUpdateGroupActions
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.scheduledUpdateGroupActions.forEach {
                try $0.validate(name: "\(name).scheduledUpdateGroupActions[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case scheduledUpdateGroupActions = "ScheduledUpdateGroupActions"
        }
    }

    public struct BlockDeviceMapping: AWSEncodableShape & AWSDecodableShape {
        /// The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh). For more information, see Device Naming on Linux Instances in the Amazon EC2 User Guide for Linux Instances.
        public let deviceName: String
        /// Parameters used to automatically set up EBS volumes when an instance is launched. You can specify either VirtualName or Ebs, but not both.
        public let ebs: Ebs?
        /// Setting this value to true suppresses the specified device included in the block device mapping of the AMI. If NoDevice is true for the root device, instances might fail the EC2 health check. In that case, Amazon EC2 Auto Scaling launches replacement instances. If you specify NoDevice, you cannot specify Ebs.
        public let noDevice: Bool?
        /// The name of the virtual device (for example, ephemeral0). You can specify either VirtualName or Ebs, but not both.
        public let virtualName: String?

        public init(deviceName: String, ebs: Ebs? = nil, noDevice: Bool? = nil, virtualName: String? = nil) {
            self.deviceName = deviceName
            self.ebs = ebs
            self.noDevice = noDevice
            self.virtualName = virtualName
        }

        public func validate(name: String) throws {
            try self.validate(self.deviceName, name: "deviceName", parent: name, max: 255)
            try self.validate(self.deviceName, name: "deviceName", parent: name, min: 1)
            try self.validate(self.deviceName, name: "deviceName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.ebs?.validate(name: "\(name).ebs")
            try self.validate(self.virtualName, name: "virtualName", parent: name, max: 255)
            try self.validate(self.virtualName, name: "virtualName", parent: name, min: 1)
            try self.validate(self.virtualName, name: "virtualName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case deviceName = "DeviceName"
            case ebs = "Ebs"
            case noDevice = "NoDevice"
            case virtualName = "VirtualName"
        }
    }

    public struct CancelInstanceRefreshAnswer: AWSDecodableShape {
        /// The instance refresh ID.
        public let instanceRefreshId: String?

        public init(instanceRefreshId: String? = nil) {
            self.instanceRefreshId = instanceRefreshId
        }

        private enum CodingKeys: String, CodingKey {
            case instanceRefreshId = "InstanceRefreshId"
        }
    }

    public struct CancelInstanceRefreshType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String

        public init(autoScalingGroupName: String) {
            self.autoScalingGroupName = autoScalingGroupName
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
        }
    }

    public struct CompleteLifecycleActionAnswer: AWSDecodableShape {
        public init() {}
    }

    public struct CompleteLifecycleActionType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The ID of the instance.
        public let instanceId: String?
        /// The action for the group to take. This parameter can be either CONTINUE or ABANDON.
        public let lifecycleActionResult: String
        /// A universally unique identifier (UUID) that identifies a specific lifecycle action associated with an instance. Amazon EC2 Auto Scaling sends this token to the notification target you specified when you created the lifecycle hook.
        public let lifecycleActionToken: String?
        /// The name of the lifecycle hook.
        public let lifecycleHookName: String

        public init(autoScalingGroupName: String, instanceId: String? = nil, lifecycleActionResult: String, lifecycleActionToken: String? = nil, lifecycleHookName: String) {
            self.autoScalingGroupName = autoScalingGroupName
            self.instanceId = instanceId
            self.lifecycleActionResult = lifecycleActionResult
            self.lifecycleActionToken = lifecycleActionToken
            self.lifecycleHookName = lifecycleHookName
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 1600)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.instanceId, name: "instanceId", parent: name, max: 19)
            try self.validate(self.instanceId, name: "instanceId", parent: name, min: 1)
            try self.validate(self.instanceId, name: "instanceId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.lifecycleActionToken, name: "lifecycleActionToken", parent: name, max: 36)
            try self.validate(self.lifecycleActionToken, name: "lifecycleActionToken", parent: name, min: 36)
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, max: 255)
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, min: 1)
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, pattern: "[A-Za-z0-9\\-_\\/]+")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case instanceId = "InstanceId"
            case lifecycleActionResult = "LifecycleActionResult"
            case lifecycleActionToken = "LifecycleActionToken"
            case lifecycleHookName = "LifecycleHookName"
        }
    }

    public struct CreateAutoScalingGroupType: AWSEncodableShape {
        /// The name of the Auto Scaling group. This name must be unique per Region per account.
        public let autoScalingGroupName: String
        /// A list of Availability Zones where instances in the Auto Scaling group can be created. This parameter is optional if you specify one or more subnets for VPCZoneIdentifier. Conditional: If your account supports EC2-Classic and VPC, this parameter is required to launch instances into EC2-Classic.
        @OptionalCustomCoding<StandardArrayCoder>
        public var availabilityZones: [String]?
        /// Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing is disabled. When you turn on Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates an old instance. For more information, see Amazon EC2 Auto Scaling Capacity Rebalancing in the Amazon EC2 Auto Scaling User Guide.
        public let capacityRebalance: Bool?
        /// The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. The default value is 300. This setting applies when using simple scaling policies, but not when using other scaling policies or scheduled scaling. For more information, see Scaling cooldowns for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
        public let defaultCooldown: Int?
        /// The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the capacity it attempts to maintain. It can scale beyond this capacity if you configure auto scaling. This number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group. If you do not specify a desired capacity, the default is the minimum size of the group.
        public let desiredCapacity: Int?
        /// The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service. During this time, any health check failures for the instance are ignored. The default value is 0. For more information, see Health check grace period in the Amazon EC2 Auto Scaling User Guide. Conditional: Required if you are adding an ELB health check.
        public let healthCheckGracePeriod: Int?
        /// The service to use for the health checks. The valid values are EC2 (default) and ELB. If you configure an Auto Scaling group to use load balancer (ELB) health checks, it considers the instance unhealthy if it fails either the EC2 status checks or the load balancer health checks. For more information, see Health checks for Auto Scaling instances in the Amazon EC2 Auto Scaling User Guide.
        public let healthCheckType: String?
        /// The ID of the instance used to base the launch configuration on. If specified, Amazon EC2 Auto Scaling uses the configuration values from the specified instance to create a new launch configuration. To get the instance ID, use the Amazon EC2 DescribeInstances API operation. For more information, see Creating an Auto Scaling group using an EC2 instance in the Amazon EC2 Auto Scaling User Guide.
        public let instanceId: String?
        /// The name of the launch configuration to use to launch instances.  Conditional: You must specify either a launch template (LaunchTemplate or MixedInstancesPolicy) or a launch configuration (LaunchConfigurationName or InstanceId).
        public let launchConfigurationName: String?
        /// Parameters used to specify the launch template and version to use to launch instances.  Conditional: You must specify either a launch template (LaunchTemplate or MixedInstancesPolicy) or a launch configuration (LaunchConfigurationName or InstanceId).  The launch template that is specified must be configured for use with an Auto Scaling group. For more information, see Creating a launch template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
        public let launchTemplate: LaunchTemplateSpecification?
        /// One or more lifecycle hooks for the group, which specify actions to perform when Amazon EC2 Auto Scaling launches or terminates instances.
        @OptionalCustomCoding<StandardArrayCoder>
        public var lifecycleHookSpecificationList: [LifecycleHookSpecification]?
        /// A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs property instead.
        @OptionalCustomCoding<StandardArrayCoder>
        public var loadBalancerNames: [String]?
        /// The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). For more information, see Replacing Auto Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide.
        public let maxInstanceLifetime: Int?
        /// The maximum size of the group.  With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above MaxSize to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go above MaxSize by more than your largest instance weight (weights that define how many units each instance contributes to the desired capacity of the group).
        public let maxSize: Int
        /// The minimum size of the group.
        public let minSize: Int
        /// An embedded object that specifies a mixed instances policy. The required parameters must be specified. If optional parameters are unspecified, their default values are used. The policy includes parameters that not only define the distribution of On-Demand Instances and Spot Instances, the maximum price to pay for Spot Instances, and how the Auto Scaling group allocates instance types to fulfill On-Demand and Spot capacities, but also the parameters that specify the instance configuration information—the launch template and instance types. The policy can also include a weight for each instance type and different launch templates for individual instance types. For more information, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide.
        public let mixedInstancesPolicy: MixedInstancesPolicy?
        /// Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in. For more information about preventing instances from terminating on scale in, see Instance scale-in protection in the Amazon EC2 Auto Scaling User Guide.
        public let newInstancesProtectedFromScaleIn: Bool?
        /// The name of an existing placement group into which to launch your instances, if any. A placement group is a logical grouping of instances within a single Availability Zone. You cannot specify multiple Availability Zones and a placement group. For more information, see Placement Groups in the Amazon EC2 User Guide for Linux Instances.
        public let placementGroup: String?
        /// The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS services on your behalf. By default, Amazon EC2 Auto Scaling uses a service-linked role named AWSServiceRoleForAutoScaling, which it creates if it does not exist. For more information, see Service-linked roles in the Amazon EC2 Auto Scaling User Guide.
        public let serviceLinkedRoleARN: String?
        /// One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a launch template but use caution. If the launch template specifies an instance tag with a key that is also specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the value specified by the Auto Scaling group. For more information, see Tagging Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide.
        @OptionalCustomCoding<StandardArrayCoder>
        public var tags: [Tag]?
        /// The Amazon Resource Names (ARN) of the target groups to associate with the Auto Scaling group. Instances are registered as targets in a target group, and traffic is routed to the target group. For more information, see Elastic Load Balancing and Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
        @OptionalCustomCoding<StandardArrayCoder>
        public var targetGroupARNs: [String]?
        /// A policy or a list of policies that are used to select the instance to terminate. These policies are executed in the order that you list them. For more information, see Controlling which Auto Scaling instances terminate during scale in in the Amazon EC2 Auto Scaling User Guide.
        @OptionalCustomCoding<StandardArrayCoder>
        public var terminationPolicies: [String]?
        /// A comma-separated list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group can be created. If you specify VPCZoneIdentifier with AvailabilityZones, the subnets that you specify for this parameter must reside in those Availability Zones. Conditional: If your account supports EC2-Classic and VPC, this parameter is required to launch instances into a VPC.
        public let vPCZoneIdentifier: String?

        public init(autoScalingGroupName: String, availabilityZones: [String]? = nil, capacityRebalance: Bool? = nil, defaultCooldown: Int? = nil, desiredCapacity: Int? = nil, healthCheckGracePeriod: Int? = nil, healthCheckType: String? = nil, instanceId: String? = nil, launchConfigurationName: String? = nil, launchTemplate: LaunchTemplateSpecification? = nil, lifecycleHookSpecificationList: [LifecycleHookSpecification]? = nil, loadBalancerNames: [String]? = nil, maxInstanceLifetime: Int? = nil, maxSize: Int, minSize: Int, mixedInstancesPolicy: MixedInstancesPolicy? = nil, newInstancesProtectedFromScaleIn: Bool? = nil, placementGroup: String? = nil, serviceLinkedRoleARN: String? = nil, tags: [Tag]? = nil, targetGroupARNs: [String]? = nil, terminationPolicies: [String]? = nil, vPCZoneIdentifier: String? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.availabilityZones = availabilityZones
            self.capacityRebalance = capacityRebalance
            self.defaultCooldown = defaultCooldown
            self.desiredCapacity = desiredCapacity
            self.healthCheckGracePeriod = healthCheckGracePeriod
            self.healthCheckType = healthCheckType
            self.instanceId = instanceId
            self.launchConfigurationName = launchConfigurationName
            self.launchTemplate = launchTemplate
            self.lifecycleHookSpecificationList = lifecycleHookSpecificationList
            self.loadBalancerNames = loadBalancerNames
            self.maxInstanceLifetime = maxInstanceLifetime
            self.maxSize = maxSize
            self.minSize = minSize
            self.mixedInstancesPolicy = mixedInstancesPolicy
            self.newInstancesProtectedFromScaleIn = newInstancesProtectedFromScaleIn
            self.placementGroup = placementGroup
            self.serviceLinkedRoleARN = serviceLinkedRoleARN
            self.tags = tags
            self.targetGroupARNs = targetGroupARNs
            self.terminationPolicies = terminationPolicies
            self.vPCZoneIdentifier = vPCZoneIdentifier
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.availabilityZones?.forEach {
                try validate($0, name: "availabilityZones[]", parent: name, max: 255)
                try validate($0, name: "availabilityZones[]", parent: name, min: 1)
                try validate($0, name: "availabilityZones[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.healthCheckType, name: "healthCheckType", parent: name, max: 32)
            try self.validate(self.healthCheckType, name: "healthCheckType", parent: name, min: 1)
            try self.validate(self.healthCheckType, name: "healthCheckType", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.instanceId, name: "instanceId", parent: name, max: 19)
            try self.validate(self.instanceId, name: "instanceId", parent: name, min: 1)
            try self.validate(self.instanceId, name: "instanceId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.launchConfigurationName, name: "launchConfigurationName", parent: name, max: 255)
            try self.validate(self.launchConfigurationName, name: "launchConfigurationName", parent: name, min: 1)
            try self.validate(self.launchConfigurationName, name: "launchConfigurationName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.launchTemplate?.validate(name: "\(name).launchTemplate")
            try self.lifecycleHookSpecificationList?.forEach {
                try $0.validate(name: "\(name).lifecycleHookSpecificationList[]")
            }
            try self.loadBalancerNames?.forEach {
                try validate($0, name: "loadBalancerNames[]", parent: name, max: 255)
                try validate($0, name: "loadBalancerNames[]", parent: name, min: 1)
                try validate($0, name: "loadBalancerNames[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.mixedInstancesPolicy?.validate(name: "\(name).mixedInstancesPolicy")
            try self.validate(self.placementGroup, name: "placementGroup", parent: name, max: 255)
            try self.validate(self.placementGroup, name: "placementGroup", parent: name, min: 1)
            try self.validate(self.placementGroup, name: "placementGroup", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.serviceLinkedRoleARN, name: "serviceLinkedRoleARN", parent: name, max: 1600)
            try self.validate(self.serviceLinkedRoleARN, name: "serviceLinkedRoleARN", parent: name, min: 1)
            try self.validate(self.serviceLinkedRoleARN, name: "serviceLinkedRoleARN", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.targetGroupARNs?.forEach {
                try validate($0, name: "targetGroupARNs[]", parent: name, max: 511)
                try validate($0, name: "targetGroupARNs[]", parent: name, min: 1)
                try validate($0, name: "targetGroupARNs[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.terminationPolicies?.forEach {
                try validate($0, name: "terminationPolicies[]", parent: name, max: 1600)
                try validate($0, name: "terminationPolicies[]", parent: name, min: 1)
                try validate($0, name: "terminationPolicies[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.vPCZoneIdentifier, name: "vPCZoneIdentifier", parent: name, max: 2047)
            try self.validate(self.vPCZoneIdentifier, name: "vPCZoneIdentifier", parent: name, min: 1)
            try self.validate(self.vPCZoneIdentifier, name: "vPCZoneIdentifier", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case availabilityZones = "AvailabilityZones"
            case capacityRebalance = "CapacityRebalance"
            case defaultCooldown = "DefaultCooldown"
            case desiredCapacity = "DesiredCapacity"
            case healthCheckGracePeriod = "HealthCheckGracePeriod"
            case healthCheckType = "HealthCheckType"
            case instanceId = "InstanceId"
            case launchConfigurationName = "LaunchConfigurationName"
            case launchTemplate = "LaunchTemplate"
            case lifecycleHookSpecificationList = "LifecycleHookSpecificationList"
            case loadBalancerNames = "LoadBalancerNames"
            case maxInstanceLifetime = "MaxInstanceLifetime"
            case maxSize = "MaxSize"
            case minSize = "MinSize"
            case mixedInstancesPolicy = "MixedInstancesPolicy"
            case newInstancesProtectedFromScaleIn = "NewInstancesProtectedFromScaleIn"
            case placementGroup = "PlacementGroup"
            case serviceLinkedRoleARN = "ServiceLinkedRoleARN"
            case tags = "Tags"
            case targetGroupARNs = "TargetGroupARNs"
            case terminationPolicies = "TerminationPolicies"
            case vPCZoneIdentifier = "VPCZoneIdentifier"
        }
    }

    public struct CreateLaunchConfigurationType: AWSEncodableShape {
        /// For Auto Scaling groups that are running in a virtual private cloud (VPC), specifies whether to assign a public IP address to the group's instances. If you specify true, each instance in the Auto Scaling group receives a unique public IP address. For more information, see Launching Auto Scaling instances in a VPC in the Amazon EC2 Auto Scaling User Guide. If you specify this parameter, you must specify at least one subnet for VPCZoneIdentifier when you create your group.  If the instance is launched into a default subnet, the default is to assign a public IP address, unless you disabled the option to assign a public IP address on the subnet. If the instance is launched into a nondefault subnet, the default is not to assign a public IP address, unless you enabled the option to assign a public IP address on the subnet.
        public let associatePublicIpAddress: Bool?
        /// A block device mapping, which specifies the block devices for the instance. You can specify virtual devices and EBS volumes. For more information, see Block Device Mapping in the Amazon EC2 User Guide for Linux Instances.
        @OptionalCustomCoding<StandardArrayCoder>
        public var blockDeviceMappings: [BlockDeviceMapping]?
        /// The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. For more information, see ClassicLink in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic instances to a VPC in the Amazon EC2 Auto Scaling User Guide. This parameter can only be used if you are launching EC2-Classic instances.
        public let classicLinkVPCId: String?
        /// The IDs of one or more security groups for the specified ClassicLink-enabled VPC. For more information, see ClassicLink in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic instances to a VPC in the Amazon EC2 Auto Scaling User Guide. If you specify the ClassicLinkVPCId parameter, you must specify this parameter.
        @OptionalCustomCoding<StandardArrayCoder>
        public var classicLinkVPCSecurityGroups: [String]?
        /// Specifies whether the launch configuration is optimized for EBS I/O (true) or not (false). The optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization is not available with all instance types. Additional fees are incurred when you enable EBS optimization for an instance type that is not EBS-optimized by default. For more information, see Amazon EBS-Optimized Instances in the Amazon EC2 User Guide for Linux Instances. The default value is false.
        public let ebsOptimized: Bool?
        /// The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. The instance profile contains the IAM role. For more information, see IAM role for applications that run on Amazon EC2 instances in the Amazon EC2 Auto Scaling User Guide.
        public let iamInstanceProfile: String?
        /// The ID of the Amazon Machine Image (AMI) that was assigned during registration. For more information, see Finding an AMI in the Amazon EC2 User Guide for Linux Instances. If you do not specify InstanceId, you must specify ImageId.
        public let imageId: String?
        /// The ID of the instance to use to create the launch configuration. The new launch configuration derives attributes from the instance, except for the block device mapping. To create a launch configuration with a block device mapping or override any other instance attributes, specify them as part of the same request. For more information, see Creating a launch configuration using an EC2 instance in the Amazon EC2 Auto Scaling User Guide. If you do not specify InstanceId, you must specify both ImageId and InstanceType.
        public let instanceId: String?
        /// Controls whether instances in this group are launched with detailed (true) or basic (false) monitoring. The default value is true (enabled).  When detailed monitoring is enabled, Amazon CloudWatch generates metrics every minute and your account is charged a fee. When you disable detailed monitoring, CloudWatch generates metrics every 5 minutes. For more information, see Configure Monitoring for Auto Scaling Instances in the Amazon EC2 Auto Scaling User Guide.
        public let instanceMonitoring: InstanceMonitoring?
        /// Specifies the instance type of the EC2 instance. For information about available instance types, see Available Instance Types in the Amazon EC2 User Guide for Linux Instances. If you do not specify InstanceId, you must specify InstanceType.
        public let instanceType: String?
        /// The ID of the kernel associated with the AMI.
        public let kernelId: String?
        /// The name of the key pair. For more information, see Amazon EC2 Key Pairs in the Amazon EC2 User Guide for Linux Instances.
        public let keyName: String?
        /// The name of the launch configuration. This name must be unique per Region per account.
        public let launchConfigurationName: String
        /// The metadata options for the instances. For more information, see Configuring the Instance Metadata Options in the Amazon EC2 Auto Scaling User Guide.
        public let metadataOptions: InstanceMetadataOptions?
        /// The tenancy of the instance. An instance with dedicated tenancy runs on isolated, single-tenant hardware and can only be launched into a VPC. To launch dedicated instances into a shared tenancy VPC (a VPC with the instance placement tenancy attribute set to default), you must set the value of this parameter to dedicated. If you specify PlacementTenancy, you must specify at least one subnet for VPCZoneIdentifier when you create your group. For more information, see Configuring instance tenancy with Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. Valid Values: default | dedicated
        public let placementTenancy: String?
        /// The ID of the RAM disk to select.
        public let ramdiskId: String?
        /// A list that contains the security groups to assign to the instances in the Auto Scaling group. [EC2-VPC] Specify the security group IDs. For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide. [EC2-Classic] Specify either the security group names or the security group IDs. For more information, see Amazon EC2 Security Groups in the Amazon EC2 User Guide for Linux Instances.
        @OptionalCustomCoding<StandardArrayCoder>
        public var securityGroups: [String]?
        /// The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot price. For more information, see Requesting Spot Instances in the Amazon EC2 Auto Scaling User Guide.  When you change your maximum price by creating a new launch configuration, running instances will continue to run as long as the maximum price for those running instances is higher than the current Spot price.
        public let spotPrice: String?
        /// The user data to make available to the launched EC2 instances. For more information, see Instance metadata and user data (Linux) and Instance metadata and user data (Windows). If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.
        public let userData: String?

        public init(associatePublicIpAddress: Bool? = nil, blockDeviceMappings: [BlockDeviceMapping]? = nil, classicLinkVPCId: String? = nil, classicLinkVPCSecurityGroups: [String]? = nil, ebsOptimized: Bool? = nil, iamInstanceProfile: String? = nil, imageId: String? = nil, instanceId: String? = nil, instanceMonitoring: InstanceMonitoring? = nil, instanceType: String? = nil, kernelId: String? = nil, keyName: String? = nil, launchConfigurationName: String, metadataOptions: InstanceMetadataOptions? = nil, placementTenancy: String? = nil, ramdiskId: String? = nil, securityGroups: [String]? = nil, spotPrice: String? = nil, userData: String? = nil) {
            self.associatePublicIpAddress = associatePublicIpAddress
            self.blockDeviceMappings = blockDeviceMappings
            self.classicLinkVPCId = classicLinkVPCId
            self.classicLinkVPCSecurityGroups = classicLinkVPCSecurityGroups
            self.ebsOptimized = ebsOptimized
            self.iamInstanceProfile = iamInstanceProfile
            self.imageId = imageId
            self.instanceId = instanceId
            self.instanceMonitoring = instanceMonitoring
            self.instanceType = instanceType
            self.kernelId = kernelId
            self.keyName = keyName
            self.launchConfigurationName = launchConfigurationName
            self.metadataOptions = metadataOptions
            self.placementTenancy = placementTenancy
            self.ramdiskId = ramdiskId
            self.securityGroups = securityGroups
            self.spotPrice = spotPrice
            self.userData = userData
        }

        public func validate(name: String) throws {
            try self.blockDeviceMappings?.forEach {
                try $0.validate(name: "\(name).blockDeviceMappings[]")
            }
            try self.validate(self.classicLinkVPCId, name: "classicLinkVPCId", parent: name, max: 255)
            try self.validate(self.classicLinkVPCId, name: "classicLinkVPCId", parent: name, min: 1)
            try self.validate(self.classicLinkVPCId, name: "classicLinkVPCId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.classicLinkVPCSecurityGroups?.forEach {
                try validate($0, name: "classicLinkVPCSecurityGroups[]", parent: name, max: 255)
                try validate($0, name: "classicLinkVPCSecurityGroups[]", parent: name, min: 1)
                try validate($0, name: "classicLinkVPCSecurityGroups[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.iamInstanceProfile, name: "iamInstanceProfile", parent: name, max: 1600)
            try self.validate(self.iamInstanceProfile, name: "iamInstanceProfile", parent: name, min: 1)
            try self.validate(self.iamInstanceProfile, name: "iamInstanceProfile", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.imageId, name: "imageId", parent: name, max: 255)
            try self.validate(self.imageId, name: "imageId", parent: name, min: 1)
            try self.validate(self.imageId, name: "imageId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.instanceId, name: "instanceId", parent: name, max: 19)
            try self.validate(self.instanceId, name: "instanceId", parent: name, min: 1)
            try self.validate(self.instanceId, name: "instanceId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.instanceType, name: "instanceType", parent: name, max: 255)
            try self.validate(self.instanceType, name: "instanceType", parent: name, min: 1)
            try self.validate(self.instanceType, name: "instanceType", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.kernelId, name: "kernelId", parent: name, max: 255)
            try self.validate(self.kernelId, name: "kernelId", parent: name, min: 1)
            try self.validate(self.kernelId, name: "kernelId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.keyName, name: "keyName", parent: name, max: 255)
            try self.validate(self.keyName, name: "keyName", parent: name, min: 1)
            try self.validate(self.keyName, name: "keyName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.launchConfigurationName, name: "launchConfigurationName", parent: name, max: 255)
            try self.validate(self.launchConfigurationName, name: "launchConfigurationName", parent: name, min: 1)
            try self.validate(self.launchConfigurationName, name: "launchConfigurationName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.metadataOptions?.validate(name: "\(name).metadataOptions")
            try self.validate(self.placementTenancy, name: "placementTenancy", parent: name, max: 64)
            try self.validate(self.placementTenancy, name: "placementTenancy", parent: name, min: 1)
            try self.validate(self.placementTenancy, name: "placementTenancy", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.ramdiskId, name: "ramdiskId", parent: name, max: 255)
            try self.validate(self.ramdiskId, name: "ramdiskId", parent: name, min: 1)
            try self.validate(self.ramdiskId, name: "ramdiskId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.securityGroups?.forEach {
                try validate($0, name: "securityGroups[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.spotPrice, name: "spotPrice", parent: name, max: 255)
            try self.validate(self.spotPrice, name: "spotPrice", parent: name, min: 1)
            try self.validate(self.userData, name: "userData", parent: name, max: 21847)
            try self.validate(self.userData, name: "userData", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case associatePublicIpAddress = "AssociatePublicIpAddress"
            case blockDeviceMappings = "BlockDeviceMappings"
            case classicLinkVPCId = "ClassicLinkVPCId"
            case classicLinkVPCSecurityGroups = "ClassicLinkVPCSecurityGroups"
            case ebsOptimized = "EbsOptimized"
            case iamInstanceProfile = "IamInstanceProfile"
            case imageId = "ImageId"
            case instanceId = "InstanceId"
            case instanceMonitoring = "InstanceMonitoring"
            case instanceType = "InstanceType"
            case kernelId = "KernelId"
            case keyName = "KeyName"
            case launchConfigurationName = "LaunchConfigurationName"
            case metadataOptions = "MetadataOptions"
            case placementTenancy = "PlacementTenancy"
            case ramdiskId = "RamdiskId"
            case securityGroups = "SecurityGroups"
            case spotPrice = "SpotPrice"
            case userData = "UserData"
        }
    }

    public struct CreateOrUpdateTagsType: AWSEncodableShape {
        /// One or more tags.
        @CustomCoding<StandardArrayCoder>
        public var tags: [Tag]

        public init(tags: [Tag]) {
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct CustomizedMetricSpecification: AWSEncodableShape & AWSDecodableShape {
        /// The dimensions of the metric. Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.
        @OptionalCustomCoding<StandardArrayCoder>
        public var dimensions: [MetricDimension]?
        /// The name of the metric.
        public let metricName: String
        /// The namespace of the metric.
        public let namespace: String
        /// The statistic of the metric.
        public let statistic: MetricStatistic
        /// The unit of the metric.
        public let unit: String?

        public init(dimensions: [MetricDimension]? = nil, metricName: String, namespace: String, statistic: MetricStatistic, unit: String? = nil) {
            self.dimensions = dimensions
            self.metricName = metricName
            self.namespace = namespace
            self.statistic = statistic
            self.unit = unit
        }

        private enum CodingKeys: String, CodingKey {
            case dimensions = "Dimensions"
            case metricName = "MetricName"
            case namespace = "Namespace"
            case statistic = "Statistic"
            case unit = "Unit"
        }
    }

    public struct DeleteAutoScalingGroupType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// Specifies that the group is to be deleted along with all instances associated with the group, without waiting for all instances to be terminated. This parameter also deletes any lifecycle actions associated with the group.
        public let forceDelete: Bool?

        public init(autoScalingGroupName: String, forceDelete: Bool? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.forceDelete = forceDelete
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case forceDelete = "ForceDelete"
        }
    }

    public struct DeleteLifecycleHookAnswer: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteLifecycleHookType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The name of the lifecycle hook.
        public let lifecycleHookName: String

        public init(autoScalingGroupName: String, lifecycleHookName: String) {
            self.autoScalingGroupName = autoScalingGroupName
            self.lifecycleHookName = lifecycleHookName
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, max: 255)
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, min: 1)
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, pattern: "[A-Za-z0-9\\-_\\/]+")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case lifecycleHookName = "LifecycleHookName"
        }
    }

    public struct DeleteNotificationConfigurationType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (Amazon SNS) topic.
        public let topicARN: String

        public init(autoScalingGroupName: String, topicARN: String) {
            self.autoScalingGroupName = autoScalingGroupName
            self.topicARN = topicARN
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.topicARN, name: "topicARN", parent: name, max: 255)
            try self.validate(self.topicARN, name: "topicARN", parent: name, min: 1)
            try self.validate(self.topicARN, name: "topicARN", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case topicARN = "TopicARN"
        }
    }

    public struct DeletePolicyType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String?
        /// The name or Amazon Resource Name (ARN) of the policy.
        public let policyName: String

        public init(autoScalingGroupName: String? = nil, policyName: String) {
            self.autoScalingGroupName = autoScalingGroupName
            self.policyName = policyName
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.policyName, name: "policyName", parent: name, max: 1600)
            try self.validate(self.policyName, name: "policyName", parent: name, min: 1)
            try self.validate(self.policyName, name: "policyName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case policyName = "PolicyName"
        }
    }

    public struct DeleteScheduledActionType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The name of the action to delete.
        public let scheduledActionName: String

        public init(autoScalingGroupName: String, scheduledActionName: String) {
            self.autoScalingGroupName = autoScalingGroupName
            self.scheduledActionName = scheduledActionName
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.scheduledActionName, name: "scheduledActionName", parent: name, max: 255)
            try self.validate(self.scheduledActionName, name: "scheduledActionName", parent: name, min: 1)
            try self.validate(self.scheduledActionName, name: "scheduledActionName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case scheduledActionName = "ScheduledActionName"
        }
    }

    public struct DeleteTagsType: AWSEncodableShape {
        /// One or more tags.
        @CustomCoding<StandardArrayCoder>
        public var tags: [Tag]

        public init(tags: [Tag]) {
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct DescribeAccountLimitsAnswer: AWSDecodableShape {
        /// The maximum number of groups allowed for your AWS account. The default is 200 groups per AWS Region.
        public let maxNumberOfAutoScalingGroups: Int?
        /// The maximum number of launch configurations allowed for your AWS account. The default is 200 launch configurations per AWS Region.
        public let maxNumberOfLaunchConfigurations: Int?
        /// The current number of groups for your AWS account.
        public let numberOfAutoScalingGroups: Int?
        /// The current number of launch configurations for your AWS account.
        public let numberOfLaunchConfigurations: Int?

        public init(maxNumberOfAutoScalingGroups: Int? = nil, maxNumberOfLaunchConfigurations: Int? = nil, numberOfAutoScalingGroups: Int? = nil, numberOfLaunchConfigurations: Int? = nil) {
            self.maxNumberOfAutoScalingGroups = maxNumberOfAutoScalingGroups
            self.maxNumberOfLaunchConfigurations = maxNumberOfLaunchConfigurations
            self.numberOfAutoScalingGroups = numberOfAutoScalingGroups
            self.numberOfLaunchConfigurations = numberOfLaunchConfigurations
        }

        private enum CodingKeys: String, CodingKey {
            case maxNumberOfAutoScalingGroups = "MaxNumberOfAutoScalingGroups"
            case maxNumberOfLaunchConfigurations = "MaxNumberOfLaunchConfigurations"
            case numberOfAutoScalingGroups = "NumberOfAutoScalingGroups"
            case numberOfLaunchConfigurations = "NumberOfLaunchConfigurations"
        }
    }

    public struct DescribeAdjustmentTypesAnswer: AWSDecodableShape {
        /// The policy adjustment types.
        @OptionalCustomCoding<StandardArrayCoder>
        public var adjustmentTypes: [AdjustmentType]?

        public init(adjustmentTypes: [AdjustmentType]? = nil) {
            self.adjustmentTypes = adjustmentTypes
        }

        private enum CodingKeys: String, CodingKey {
            case adjustmentTypes = "AdjustmentTypes"
        }
    }

    public struct DescribeAutoScalingInstancesType: AWSEncodableShape {
        /// The IDs of the instances. You can specify up to MaxRecords IDs. If you omit this parameter, all Auto Scaling instances are described. If you specify an ID that does not exist, it is ignored with no error.
        @OptionalCustomCoding<StandardArrayCoder>
        public var instanceIds: [String]?
        /// The maximum number of items to return with this call. The default value is 50 and the maximum value is 50.
        public let maxRecords: Int?
        /// The token for the next set of items to return. (You received this token from a previous call.)
        public let nextToken: String?

        public init(instanceIds: [String]? = nil, maxRecords: Int? = nil, nextToken: String? = nil) {
            self.instanceIds = instanceIds
            self.maxRecords = maxRecords
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.instanceIds?.forEach {
                try validate($0, name: "instanceIds[]", parent: name, max: 19)
                try validate($0, name: "instanceIds[]", parent: name, min: 1)
                try validate($0, name: "instanceIds[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case instanceIds = "InstanceIds"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeAutoScalingNotificationTypesAnswer: AWSDecodableShape {
        /// The notification types.
        @OptionalCustomCoding<StandardArrayCoder>
        public var autoScalingNotificationTypes: [String]?

        public init(autoScalingNotificationTypes: [String]? = nil) {
            self.autoScalingNotificationTypes = autoScalingNotificationTypes
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingNotificationTypes = "AutoScalingNotificationTypes"
        }
    }

    public struct DescribeInstanceRefreshesAnswer: AWSDecodableShape {
        /// The instance refreshes for the specified group.
        @OptionalCustomCoding<StandardArrayCoder>
        public var instanceRefreshes: [InstanceRefresh]?
        /// A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.
        public let nextToken: String?

        public init(instanceRefreshes: [InstanceRefresh]? = nil, nextToken: String? = nil) {
            self.instanceRefreshes = instanceRefreshes
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case instanceRefreshes = "InstanceRefreshes"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeInstanceRefreshesType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// One or more instance refresh IDs.
        @OptionalCustomCoding<StandardArrayCoder>
        public var instanceRefreshIds: [String]?
        /// The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.
        public let maxRecords: Int?
        /// The token for the next set of items to return. (You received this token from a previous call.)
        public let nextToken: String?

        public init(autoScalingGroupName: String, instanceRefreshIds: [String]? = nil, maxRecords: Int? = nil, nextToken: String? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.instanceRefreshIds = instanceRefreshIds
            self.maxRecords = maxRecords
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.instanceRefreshIds?.forEach {
                try validate($0, name: "instanceRefreshIds[]", parent: name, max: 255)
                try validate($0, name: "instanceRefreshIds[]", parent: name, min: 1)
                try validate($0, name: "instanceRefreshIds[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case instanceRefreshIds = "InstanceRefreshIds"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeLifecycleHookTypesAnswer: AWSDecodableShape {
        /// The lifecycle hook types.
        @OptionalCustomCoding<StandardArrayCoder>
        public var lifecycleHookTypes: [String]?

        public init(lifecycleHookTypes: [String]? = nil) {
            self.lifecycleHookTypes = lifecycleHookTypes
        }

        private enum CodingKeys: String, CodingKey {
            case lifecycleHookTypes = "LifecycleHookTypes"
        }
    }

    public struct DescribeLifecycleHooksAnswer: AWSDecodableShape {
        /// The lifecycle hooks for the specified group.
        @OptionalCustomCoding<StandardArrayCoder>
        public var lifecycleHooks: [LifecycleHook]?

        public init(lifecycleHooks: [LifecycleHook]? = nil) {
            self.lifecycleHooks = lifecycleHooks
        }

        private enum CodingKeys: String, CodingKey {
            case lifecycleHooks = "LifecycleHooks"
        }
    }

    public struct DescribeLifecycleHooksType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The names of one or more lifecycle hooks. If you omit this parameter, all lifecycle hooks are described.
        @OptionalCustomCoding<StandardArrayCoder>
        public var lifecycleHookNames: [String]?

        public init(autoScalingGroupName: String, lifecycleHookNames: [String]? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.lifecycleHookNames = lifecycleHookNames
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.lifecycleHookNames?.forEach {
                try validate($0, name: "lifecycleHookNames[]", parent: name, max: 255)
                try validate($0, name: "lifecycleHookNames[]", parent: name, min: 1)
                try validate($0, name: "lifecycleHookNames[]", parent: name, pattern: "[A-Za-z0-9\\-_\\/]+")
            }
            try self.validate(self.lifecycleHookNames, name: "lifecycleHookNames", parent: name, max: 50)
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case lifecycleHookNames = "LifecycleHookNames"
        }
    }

    public struct DescribeLoadBalancerTargetGroupsRequest: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The maximum number of items to return with this call. The default value is 100 and the maximum value is 100.
        public let maxRecords: Int?
        /// The token for the next set of items to return. (You received this token from a previous call.)
        public let nextToken: String?

        public init(autoScalingGroupName: String, maxRecords: Int? = nil, nextToken: String? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.maxRecords = maxRecords
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeLoadBalancerTargetGroupsResponse: AWSDecodableShape {
        /// Information about the target groups.
        @OptionalCustomCoding<StandardArrayCoder>
        public var loadBalancerTargetGroups: [LoadBalancerTargetGroupState]?
        /// A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.
        public let nextToken: String?

        public init(loadBalancerTargetGroups: [LoadBalancerTargetGroupState]? = nil, nextToken: String? = nil) {
            self.loadBalancerTargetGroups = loadBalancerTargetGroups
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case loadBalancerTargetGroups = "LoadBalancerTargetGroups"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeLoadBalancersRequest: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The maximum number of items to return with this call. The default value is 100 and the maximum value is 100.
        public let maxRecords: Int?
        /// The token for the next set of items to return. (You received this token from a previous call.)
        public let nextToken: String?

        public init(autoScalingGroupName: String, maxRecords: Int? = nil, nextToken: String? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.maxRecords = maxRecords
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeLoadBalancersResponse: AWSDecodableShape {
        /// The load balancers.
        @OptionalCustomCoding<StandardArrayCoder>
        public var loadBalancers: [LoadBalancerState]?
        /// A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.
        public let nextToken: String?

        public init(loadBalancers: [LoadBalancerState]? = nil, nextToken: String? = nil) {
            self.loadBalancers = loadBalancers
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case loadBalancers = "LoadBalancers"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeMetricCollectionTypesAnswer: AWSDecodableShape {
        /// The granularities for the metrics.
        @OptionalCustomCoding<StandardArrayCoder>
        public var granularities: [MetricGranularityType]?
        /// One or more metrics.
        @OptionalCustomCoding<StandardArrayCoder>
        public var metrics: [MetricCollectionType]?

        public init(granularities: [MetricGranularityType]? = nil, metrics: [MetricCollectionType]? = nil) {
            self.granularities = granularities
            self.metrics = metrics
        }

        private enum CodingKeys: String, CodingKey {
            case granularities = "Granularities"
            case metrics = "Metrics"
        }
    }

    public struct DescribeNotificationConfigurationsAnswer: AWSDecodableShape {
        /// A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.
        public let nextToken: String?
        /// The notification configurations.
        @CustomCoding<StandardArrayCoder>
        public var notificationConfigurations: [NotificationConfiguration]

        public init(nextToken: String? = nil, notificationConfigurations: [NotificationConfiguration]) {
            self.nextToken = nextToken
            self.notificationConfigurations = notificationConfigurations
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case notificationConfigurations = "NotificationConfigurations"
        }
    }

    public struct DescribeNotificationConfigurationsType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        @OptionalCustomCoding<StandardArrayCoder>
        public var autoScalingGroupNames: [String]?
        /// The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.
        public let maxRecords: Int?
        /// The token for the next set of items to return. (You received this token from a previous call.)
        public let nextToken: String?

        public init(autoScalingGroupNames: [String]? = nil, maxRecords: Int? = nil, nextToken: String? = nil) {
            self.autoScalingGroupNames = autoScalingGroupNames
            self.maxRecords = maxRecords
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.autoScalingGroupNames?.forEach {
                try validate($0, name: "autoScalingGroupNames[]", parent: name, max: 255)
                try validate($0, name: "autoScalingGroupNames[]", parent: name, min: 1)
                try validate($0, name: "autoScalingGroupNames[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupNames = "AutoScalingGroupNames"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
        }
    }

    public struct DescribePoliciesType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String?
        /// The maximum number of items to be returned with each call. The default value is 50 and the maximum value is 100.
        public let maxRecords: Int?
        /// The token for the next set of items to return. (You received this token from a previous call.)
        public let nextToken: String?
        /// The names of one or more policies. If you omit this parameter, all policies are described. If a group name is provided, the results are limited to that group. This list is limited to 50 items. If you specify an unknown policy name, it is ignored with no error.
        @OptionalCustomCoding<StandardArrayCoder>
        public var policyNames: [String]?
        /// One or more policy types. The valid values are SimpleScaling, StepScaling, and TargetTrackingScaling.
        @OptionalCustomCoding<StandardArrayCoder>
        public var policyTypes: [String]?

        public init(autoScalingGroupName: String? = nil, maxRecords: Int? = nil, nextToken: String? = nil, policyNames: [String]? = nil, policyTypes: [String]? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.maxRecords = maxRecords
            self.nextToken = nextToken
            self.policyNames = policyNames
            self.policyTypes = policyTypes
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.policyNames?.forEach {
                try validate($0, name: "policyNames[]", parent: name, max: 1600)
                try validate($0, name: "policyNames[]", parent: name, min: 1)
                try validate($0, name: "policyNames[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.policyTypes?.forEach {
                try validate($0, name: "policyTypes[]", parent: name, max: 64)
                try validate($0, name: "policyTypes[]", parent: name, min: 1)
                try validate($0, name: "policyTypes[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
            case policyNames = "PolicyNames"
            case policyTypes = "PolicyTypes"
        }
    }

    public struct DescribeScalingActivitiesType: AWSEncodableShape {
        /// The activity IDs of the desired scaling activities. You can specify up to 50 IDs. If you omit this parameter, all activities for the past six weeks are described. If unknown activities are requested, they are ignored with no error. If you specify an Auto Scaling group, the results are limited to that group.
        @OptionalCustomCoding<StandardArrayCoder>
        public var activityIds: [String]?
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String?
        /// Indicates whether to include scaling activity from deleted Auto Scaling groups.
        public let includeDeletedGroups: Bool?
        /// The maximum number of items to return with this call. The default value is 100 and the maximum value is 100.
        public let maxRecords: Int?
        /// The token for the next set of items to return. (You received this token from a previous call.)
        public let nextToken: String?

        public init(activityIds: [String]? = nil, autoScalingGroupName: String? = nil, includeDeletedGroups: Bool? = nil, maxRecords: Int? = nil, nextToken: String? = nil) {
            self.activityIds = activityIds
            self.autoScalingGroupName = autoScalingGroupName
            self.includeDeletedGroups = includeDeletedGroups
            self.maxRecords = maxRecords
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.activityIds?.forEach {
                try validate($0, name: "activityIds[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case activityIds = "ActivityIds"
            case autoScalingGroupName = "AutoScalingGroupName"
            case includeDeletedGroups = "IncludeDeletedGroups"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeScheduledActionsType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String?
        /// The latest scheduled start time to return. If scheduled action names are provided, this parameter is ignored.
        public let endTime: Date?
        /// The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.
        public let maxRecords: Int?
        /// The token for the next set of items to return. (You received this token from a previous call.)
        public let nextToken: String?
        /// The names of one or more scheduled actions. You can specify up to 50 actions. If you omit this parameter, all scheduled actions are described. If you specify an unknown scheduled action, it is ignored with no error.
        @OptionalCustomCoding<StandardArrayCoder>
        public var scheduledActionNames: [String]?
        /// The earliest scheduled start time to return. If scheduled action names are provided, this parameter is ignored.
        public let startTime: Date?

        public init(autoScalingGroupName: String? = nil, endTime: Date? = nil, maxRecords: Int? = nil, nextToken: String? = nil, scheduledActionNames: [String]? = nil, startTime: Date? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.endTime = endTime
            self.maxRecords = maxRecords
            self.nextToken = nextToken
            self.scheduledActionNames = scheduledActionNames
            self.startTime = startTime
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.scheduledActionNames?.forEach {
                try validate($0, name: "scheduledActionNames[]", parent: name, max: 255)
                try validate($0, name: "scheduledActionNames[]", parent: name, min: 1)
                try validate($0, name: "scheduledActionNames[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case endTime = "EndTime"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
            case scheduledActionNames = "ScheduledActionNames"
            case startTime = "StartTime"
        }
    }

    public struct DescribeTagsType: AWSEncodableShape {
        /// One or more filters to scope the tags to return. The maximum number of filters per filter type (for example, auto-scaling-group) is 1000.
        @OptionalCustomCoding<StandardArrayCoder>
        public var filters: [Filter]?
        /// The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.
        public let maxRecords: Int?
        /// The token for the next set of items to return. (You received this token from a previous call.)
        public let nextToken: String?

        public init(filters: [Filter]? = nil, maxRecords: Int? = nil, nextToken: String? = nil) {
            self.filters = filters
            self.maxRecords = maxRecords
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.filters?.forEach {
                try $0.validate(name: "\(name).filters[]")
            }
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case filters = "Filters"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeTerminationPolicyTypesAnswer: AWSDecodableShape {
        /// The termination policies supported by Amazon EC2 Auto Scaling: OldestInstance, OldestLaunchConfiguration, NewestInstance, ClosestToNextInstanceHour, Default, OldestLaunchTemplate, and AllocationStrategy.
        @OptionalCustomCoding<StandardArrayCoder>
        public var terminationPolicyTypes: [String]?

        public init(terminationPolicyTypes: [String]? = nil) {
            self.terminationPolicyTypes = terminationPolicyTypes
        }

        private enum CodingKeys: String, CodingKey {
            case terminationPolicyTypes = "TerminationPolicyTypes"
        }
    }

    public struct DetachInstancesAnswer: AWSDecodableShape {
        /// The activities related to detaching the instances from the Auto Scaling group.
        @OptionalCustomCoding<StandardArrayCoder>
        public var activities: [Activity]?

        public init(activities: [Activity]? = nil) {
            self.activities = activities
        }

        private enum CodingKeys: String, CodingKey {
            case activities = "Activities"
        }
    }

    public struct DetachInstancesQuery: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The IDs of the instances. You can specify up to 20 instances.
        @OptionalCustomCoding<StandardArrayCoder>
        public var instanceIds: [String]?
        /// Indicates whether the Auto Scaling group decrements the desired capacity value by the number of instances detached.
        public let shouldDecrementDesiredCapacity: Bool

        public init(autoScalingGroupName: String, instanceIds: [String]? = nil, shouldDecrementDesiredCapacity: Bool) {
            self.autoScalingGroupName = autoScalingGroupName
            self.instanceIds = instanceIds
            self.shouldDecrementDesiredCapacity = shouldDecrementDesiredCapacity
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.instanceIds?.forEach {
                try validate($0, name: "instanceIds[]", parent: name, max: 19)
                try validate($0, name: "instanceIds[]", parent: name, min: 1)
                try validate($0, name: "instanceIds[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case instanceIds = "InstanceIds"
            case shouldDecrementDesiredCapacity = "ShouldDecrementDesiredCapacity"
        }
    }

    public struct DetachLoadBalancerTargetGroupsResultType: AWSDecodableShape {
        public init() {}
    }

    public struct DetachLoadBalancerTargetGroupsType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The Amazon Resource Names (ARN) of the target groups. You can specify up to 10 target groups.
        @CustomCoding<StandardArrayCoder>
        public var targetGroupARNs: [String]

        public init(autoScalingGroupName: String, targetGroupARNs: [String]) {
            self.autoScalingGroupName = autoScalingGroupName
            self.targetGroupARNs = targetGroupARNs
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.targetGroupARNs.forEach {
                try validate($0, name: "targetGroupARNs[]", parent: name, max: 511)
                try validate($0, name: "targetGroupARNs[]", parent: name, min: 1)
                try validate($0, name: "targetGroupARNs[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case targetGroupARNs = "TargetGroupARNs"
        }
    }

    public struct DetachLoadBalancersResultType: AWSDecodableShape {
        public init() {}
    }

    public struct DetachLoadBalancersType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The names of the load balancers. You can specify up to 10 load balancers.
        @CustomCoding<StandardArrayCoder>
        public var loadBalancerNames: [String]

        public init(autoScalingGroupName: String, loadBalancerNames: [String]) {
            self.autoScalingGroupName = autoScalingGroupName
            self.loadBalancerNames = loadBalancerNames
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.loadBalancerNames.forEach {
                try validate($0, name: "loadBalancerNames[]", parent: name, max: 255)
                try validate($0, name: "loadBalancerNames[]", parent: name, min: 1)
                try validate($0, name: "loadBalancerNames[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case loadBalancerNames = "LoadBalancerNames"
        }
    }

    public struct DisableMetricsCollectionQuery: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// Specifies one or more of the following metrics:    GroupMinSize     GroupMaxSize     GroupDesiredCapacity     GroupInServiceInstances     GroupPendingInstances     GroupStandbyInstances     GroupTerminatingInstances     GroupTotalInstances     GroupInServiceCapacity     GroupPendingCapacity     GroupStandbyCapacity     GroupTerminatingCapacity     GroupTotalCapacity    If you omit this parameter, all metrics are disabled.
        @OptionalCustomCoding<StandardArrayCoder>
        public var metrics: [String]?

        public init(autoScalingGroupName: String, metrics: [String]? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.metrics = metrics
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.metrics?.forEach {
                try validate($0, name: "metrics[]", parent: name, max: 255)
                try validate($0, name: "metrics[]", parent: name, min: 1)
                try validate($0, name: "metrics[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case metrics = "Metrics"
        }
    }

    public struct Ebs: AWSEncodableShape & AWSDecodableShape {
        /// Indicates whether the volume is deleted on instance termination. For Amazon EC2 Auto Scaling, the default value is true.
        public let deleteOnTermination: Bool?
        /// Specifies whether the volume should be encrypted. Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types. If your AMI uses encrypted volumes, you can also only launch it on supported instance types.  If you are creating a volume from a snapshot, you cannot specify an encryption value. Volumes that are created from encrypted snapshots are automatically encrypted, and volumes that are created from unencrypted snapshots are automatically unencrypted. By default, encrypted snapshots use the AWS managed CMK that is used for EBS encryption, but you can specify a custom CMK when you create the snapshot. The ability to encrypt a snapshot during copying also allows you to apply a new CMK to an already-encrypted snapshot. Volumes restored from the resulting copy are only accessible using the new CMK. Enabling encryption by default results in all EBS volumes being encrypted with the AWS managed CMK or a customer managed CMK, whether or not the snapshot was encrypted.  For more information, see Using Encryption with EBS-Backed AMIs in the Amazon EC2 User Guide for Linux Instances and Required CMK key policy for use with encrypted volumes in the Amazon EC2 Auto Scaling User Guide.
        public let encrypted: Bool?
        /// The number of I/O operations per second (IOPS) to provision for the volume. The maximum ratio of IOPS to volume size (in GiB) is 50:1. For more information, see Amazon EBS Volume Types in the Amazon EC2 User Guide for Linux Instances. Required when the volume type is io1. (Not used with standard, gp2, st1, or sc1 volumes.)
        public let iops: Int?
        /// The snapshot ID of the volume to use. You must specify either a VolumeSize or a SnapshotId.
        public let snapshotId: String?
        /// The volume size, in Gibibytes (GiB). This can be a number from 1-1,024 for standard, 4-16,384 for io1, 1-16,384 for gp2, and 500-16,384 for st1 and sc1. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size. Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the snapshot size. You must specify either a VolumeSize or a SnapshotId. If you specify both SnapshotId and VolumeSize, the volume size must be equal or greater than the size of the snapshot.
        public let volumeSize: Int?
        /// The volume type, which can be standard for Magnetic, io1 for Provisioned IOPS SSD, gp2 for General Purpose SSD, st1 for Throughput Optimized HDD, or sc1 for Cold HDD. For more information, see Amazon EBS Volume Types in the Amazon EC2 User Guide for Linux Instances. Valid Values: standard | io1 | gp2 | st1 | sc1
        public let volumeType: String?

        public init(deleteOnTermination: Bool? = nil, encrypted: Bool? = nil, iops: Int? = nil, snapshotId: String? = nil, volumeSize: Int? = nil, volumeType: String? = nil) {
            self.deleteOnTermination = deleteOnTermination
            self.encrypted = encrypted
            self.iops = iops
            self.snapshotId = snapshotId
            self.volumeSize = volumeSize
            self.volumeType = volumeType
        }

        public func validate(name: String) throws {
            try self.validate(self.iops, name: "iops", parent: name, max: 20000)
            try self.validate(self.iops, name: "iops", parent: name, min: 100)
            try self.validate(self.snapshotId, name: "snapshotId", parent: name, max: 255)
            try self.validate(self.snapshotId, name: "snapshotId", parent: name, min: 1)
            try self.validate(self.snapshotId, name: "snapshotId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.volumeSize, name: "volumeSize", parent: name, max: 16384)
            try self.validate(self.volumeSize, name: "volumeSize", parent: name, min: 1)
            try self.validate(self.volumeType, name: "volumeType", parent: name, max: 255)
            try self.validate(self.volumeType, name: "volumeType", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case deleteOnTermination = "DeleteOnTermination"
            case encrypted = "Encrypted"
            case iops = "Iops"
            case snapshotId = "SnapshotId"
            case volumeSize = "VolumeSize"
            case volumeType = "VolumeType"
        }
    }

    public struct EnableMetricsCollectionQuery: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The granularity to associate with the metrics to collect. The only valid value is 1Minute.
        public let granularity: String
        /// Specifies which group-level metrics to start collecting. You can specify one or more of the following metrics:    GroupMinSize     GroupMaxSize     GroupDesiredCapacity     GroupInServiceInstances     GroupPendingInstances     GroupStandbyInstances     GroupTerminatingInstances     GroupTotalInstances    The instance weighting feature supports the following additional metrics:     GroupInServiceCapacity     GroupPendingCapacity     GroupStandbyCapacity     GroupTerminatingCapacity     GroupTotalCapacity    If you omit this parameter, all metrics are enabled.
        @OptionalCustomCoding<StandardArrayCoder>
        public var metrics: [String]?

        public init(autoScalingGroupName: String, granularity: String, metrics: [String]? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.granularity = granularity
            self.metrics = metrics
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.granularity, name: "granularity", parent: name, max: 255)
            try self.validate(self.granularity, name: "granularity", parent: name, min: 1)
            try self.validate(self.granularity, name: "granularity", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.metrics?.forEach {
                try validate($0, name: "metrics[]", parent: name, max: 255)
                try validate($0, name: "metrics[]", parent: name, min: 1)
                try validate($0, name: "metrics[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case granularity = "Granularity"
            case metrics = "Metrics"
        }
    }

    public struct EnabledMetric: AWSDecodableShape {
        /// The granularity of the metric. The only valid value is 1Minute.
        public let granularity: String?
        /// One of the following metrics:    GroupMinSize     GroupMaxSize     GroupDesiredCapacity     GroupInServiceInstances     GroupPendingInstances     GroupStandbyInstances     GroupTerminatingInstances     GroupTotalInstances     GroupInServiceCapacity     GroupPendingCapacity     GroupStandbyCapacity     GroupTerminatingCapacity     GroupTotalCapacity
        public let metric: String?

        public init(granularity: String? = nil, metric: String? = nil) {
            self.granularity = granularity
            self.metric = metric
        }

        private enum CodingKeys: String, CodingKey {
            case granularity = "Granularity"
            case metric = "Metric"
        }
    }

    public struct EnterStandbyAnswer: AWSDecodableShape {
        /// The activities related to moving instances into Standby mode.
        @OptionalCustomCoding<StandardArrayCoder>
        public var activities: [Activity]?

        public init(activities: [Activity]? = nil) {
            self.activities = activities
        }

        private enum CodingKeys: String, CodingKey {
            case activities = "Activities"
        }
    }

    public struct EnterStandbyQuery: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The IDs of the instances. You can specify up to 20 instances.
        @OptionalCustomCoding<StandardArrayCoder>
        public var instanceIds: [String]?
        /// Indicates whether to decrement the desired capacity of the Auto Scaling group by the number of instances moved to Standby mode.
        public let shouldDecrementDesiredCapacity: Bool

        public init(autoScalingGroupName: String, instanceIds: [String]? = nil, shouldDecrementDesiredCapacity: Bool) {
            self.autoScalingGroupName = autoScalingGroupName
            self.instanceIds = instanceIds
            self.shouldDecrementDesiredCapacity = shouldDecrementDesiredCapacity
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.instanceIds?.forEach {
                try validate($0, name: "instanceIds[]", parent: name, max: 19)
                try validate($0, name: "instanceIds[]", parent: name, min: 1)
                try validate($0, name: "instanceIds[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case instanceIds = "InstanceIds"
            case shouldDecrementDesiredCapacity = "ShouldDecrementDesiredCapacity"
        }
    }

    public struct ExecutePolicyType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String?
        /// The breach threshold for the alarm. Required if the policy type is StepScaling and not supported otherwise.
        public let breachThreshold: Double?
        /// Indicates whether Amazon EC2 Auto Scaling waits for the cooldown period to complete before executing the policy. Valid only if the policy type is SimpleScaling. For more information, see Scaling cooldowns for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
        public let honorCooldown: Bool?
        /// The metric value to compare to BreachThreshold. This enables you to execute a policy of type StepScaling and determine which step adjustment to use. For example, if the breach threshold is 50 and you want to use a step adjustment with a lower bound of 0 and an upper bound of 10, you can set the metric value to 59. If you specify a metric value that doesn't correspond to a step adjustment for the policy, the call returns an error. Required if the policy type is StepScaling and not supported otherwise.
        public let metricValue: Double?
        /// The name or ARN of the policy.
        public let policyName: String

        public init(autoScalingGroupName: String? = nil, breachThreshold: Double? = nil, honorCooldown: Bool? = nil, metricValue: Double? = nil, policyName: String) {
            self.autoScalingGroupName = autoScalingGroupName
            self.breachThreshold = breachThreshold
            self.honorCooldown = honorCooldown
            self.metricValue = metricValue
            self.policyName = policyName
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.policyName, name: "policyName", parent: name, max: 1600)
            try self.validate(self.policyName, name: "policyName", parent: name, min: 1)
            try self.validate(self.policyName, name: "policyName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case breachThreshold = "BreachThreshold"
            case honorCooldown = "HonorCooldown"
            case metricValue = "MetricValue"
            case policyName = "PolicyName"
        }
    }

    public struct ExitStandbyAnswer: AWSDecodableShape {
        /// The activities related to moving instances out of Standby mode.
        @OptionalCustomCoding<StandardArrayCoder>
        public var activities: [Activity]?

        public init(activities: [Activity]? = nil) {
            self.activities = activities
        }

        private enum CodingKeys: String, CodingKey {
            case activities = "Activities"
        }
    }

    public struct ExitStandbyQuery: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The IDs of the instances. You can specify up to 20 instances.
        @OptionalCustomCoding<StandardArrayCoder>
        public var instanceIds: [String]?

        public init(autoScalingGroupName: String, instanceIds: [String]? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.instanceIds = instanceIds
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.instanceIds?.forEach {
                try validate($0, name: "instanceIds[]", parent: name, max: 19)
                try validate($0, name: "instanceIds[]", parent: name, min: 1)
                try validate($0, name: "instanceIds[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case instanceIds = "InstanceIds"
        }
    }

    public struct FailedScheduledUpdateGroupActionRequest: AWSDecodableShape {
        /// The error code.
        public let errorCode: String?
        /// The error message accompanying the error code.
        public let errorMessage: String?
        /// The name of the scheduled action.
        public let scheduledActionName: String

        public init(errorCode: String? = nil, errorMessage: String? = nil, scheduledActionName: String) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.scheduledActionName = scheduledActionName
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case scheduledActionName = "ScheduledActionName"
        }
    }

    public struct Filter: AWSEncodableShape {
        /// The name of the filter. The valid values are: auto-scaling-group, key, value, and propagate-at-launch.
        public let name: String?
        /// One or more filter values. Filter values are case-sensitive.
        @OptionalCustomCoding<StandardArrayCoder>
        public var values: [String]?

        public init(name: String? = nil, values: [String]? = nil) {
            self.name = name
            self.values = values
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.values?.forEach {
                try validate($0, name: "values[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case values = "Values"
        }
    }

    public struct Instance: AWSDecodableShape {
        /// The Availability Zone in which the instance is running.
        public let availabilityZone: String
        /// The last reported health status of the instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy and that Amazon EC2 Auto Scaling should terminate and replace it.
        public let healthStatus: String
        /// The ID of the instance.
        public let instanceId: String
        /// The instance type of the EC2 instance.
        public let instanceType: String?
        /// The launch configuration associated with the instance.
        public let launchConfigurationName: String?
        /// The launch template for the instance.
        public let launchTemplate: LaunchTemplateSpecification?
        /// A description of the current lifecycle state. The Quarantined state is not used. For information about lifecycle states, see Instance lifecycle in the Amazon EC2 Auto Scaling User Guide.
        public let lifecycleState: LifecycleState
        /// Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in.
        public let protectedFromScaleIn: Bool
        /// The number of capacity units contributed by the instance based on its instance type. Valid Range: Minimum value of 1. Maximum value of 999.
        public let weightedCapacity: String?

        public init(availabilityZone: String, healthStatus: String, instanceId: String, instanceType: String? = nil, launchConfigurationName: String? = nil, launchTemplate: LaunchTemplateSpecification? = nil, lifecycleState: LifecycleState, protectedFromScaleIn: Bool, weightedCapacity: String? = nil) {
            self.availabilityZone = availabilityZone
            self.healthStatus = healthStatus
            self.instanceId = instanceId
            self.instanceType = instanceType
            self.launchConfigurationName = launchConfigurationName
            self.launchTemplate = launchTemplate
            self.lifecycleState = lifecycleState
            self.protectedFromScaleIn = protectedFromScaleIn
            self.weightedCapacity = weightedCapacity
        }

        private enum CodingKeys: String, CodingKey {
            case availabilityZone = "AvailabilityZone"
            case healthStatus = "HealthStatus"
            case instanceId = "InstanceId"
            case instanceType = "InstanceType"
            case launchConfigurationName = "LaunchConfigurationName"
            case launchTemplate = "LaunchTemplate"
            case lifecycleState = "LifecycleState"
            case protectedFromScaleIn = "ProtectedFromScaleIn"
            case weightedCapacity = "WeightedCapacity"
        }
    }

    public struct InstanceMetadataOptions: AWSEncodableShape & AWSDecodableShape {
        /// This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default state is enabled.  If you specify a value of disabled, you will not be able to access your instance metadata.
        public let httpEndpoint: InstanceMetadataEndpointState?
        /// The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel. Default: 1
        public let httpPutResponseHopLimit: Int?
        /// The state of token usage for your instance metadata requests. If the parameter is not specified in the request, the default state is optional. If the state is optional, you can choose to retrieve instance metadata with or without a signed token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0 role credentials are returned. If the state is required, you must send a signed token header with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the version 1.0 credentials are not available.
        public let httpTokens: InstanceMetadataHttpTokensState?

        public init(httpEndpoint: InstanceMetadataEndpointState? = nil, httpPutResponseHopLimit: Int? = nil, httpTokens: InstanceMetadataHttpTokensState? = nil) {
            self.httpEndpoint = httpEndpoint
            self.httpPutResponseHopLimit = httpPutResponseHopLimit
            self.httpTokens = httpTokens
        }

        public func validate(name: String) throws {
            try self.validate(self.httpPutResponseHopLimit, name: "httpPutResponseHopLimit", parent: name, max: 64)
            try self.validate(self.httpPutResponseHopLimit, name: "httpPutResponseHopLimit", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case httpEndpoint = "HttpEndpoint"
            case httpPutResponseHopLimit = "HttpPutResponseHopLimit"
            case httpTokens = "HttpTokens"
        }
    }

    public struct InstanceMonitoring: AWSEncodableShape & AWSDecodableShape {
        /// If true, detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
        public let enabled: Bool?

        public init(enabled: Bool? = nil) {
            self.enabled = enabled
        }

        private enum CodingKeys: String, CodingKey {
            case enabled = "Enabled"
        }
    }

    public struct InstanceRefresh: AWSDecodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String?
        /// The date and time at which the instance refresh ended.
        public let endTime: Date?
        /// The instance refresh ID.
        public let instanceRefreshId: String?
        /// The number of instances remaining to update before the instance refresh is complete.
        public let instancesToUpdate: Int?
        /// The percentage of the instance refresh that is complete. For each instance replacement, Amazon EC2 Auto Scaling tracks the instance's health status and warm-up time. When the instance's health status changes to healthy and the specified warm-up time passes, the instance is considered updated and added to the percentage complete.
        public let percentageComplete: Int?
        /// The date and time at which the instance refresh began.
        public let startTime: Date?
        /// The current status for the instance refresh operation:    Pending - The request was created, but the operation has not started.    InProgress - The operation is in progress.    Successful - The operation completed successfully.    Failed - The operation failed to complete. You can troubleshoot using the status reason and the scaling activities.     Cancelling - An ongoing operation is being cancelled. Cancellation does not roll back any replacements that have already been completed, but it prevents new replacements from being started.     Cancelled - The operation is cancelled.
        public let status: InstanceRefreshStatus?
        /// Provides more details about the current status of the instance refresh.
        public let statusReason: String?

        public init(autoScalingGroupName: String? = nil, endTime: Date? = nil, instanceRefreshId: String? = nil, instancesToUpdate: Int? = nil, percentageComplete: Int? = nil, startTime: Date? = nil, status: InstanceRefreshStatus? = nil, statusReason: String? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.endTime = endTime
            self.instanceRefreshId = instanceRefreshId
            self.instancesToUpdate = instancesToUpdate
            self.percentageComplete = percentageComplete
            self.startTime = startTime
            self.status = status
            self.statusReason = statusReason
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case endTime = "EndTime"
            case instanceRefreshId = "InstanceRefreshId"
            case instancesToUpdate = "InstancesToUpdate"
            case percentageComplete = "PercentageComplete"
            case startTime = "StartTime"
            case status = "Status"
            case statusReason = "StatusReason"
        }
    }

    public struct InstancesDistribution: AWSEncodableShape & AWSDecodableShape {
        /// Indicates how to allocate instance types to fulfill On-Demand capacity. The only valid value is prioritized, which is also the default value. This strategy uses the order of instance types in the overrides to define the launch priority of each instance type. The first instance type in the array is prioritized higher than the last. If all your On-Demand capacity cannot be fulfilled using your highest priority instance, then the Auto Scaling groups launches the remaining capacity using the second priority instance type, and so on.
        public let onDemandAllocationStrategy: String?
        /// The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. This base portion is provisioned first as your group scales. Defaults to 0 if not specified. If you specify weights for the instance types in the overrides, set the value of OnDemandBaseCapacity in terms of the number of capacity units, and not the number of instances.
        public let onDemandBaseCapacity: Int?
        /// Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond OnDemandBaseCapacity. Expressed as a number (for example, 20 specifies 20% On-Demand Instances, 80% Spot Instances). Defaults to 100 if not specified. If set to 100, only On-Demand Instances are provisioned.
        public let onDemandPercentageAboveBaseCapacity: Int?
        /// Indicates how to allocate instances across Spot Instance pools. If the allocation strategy is capacity-optimized (recommended), the Auto Scaling group launches instances using Spot pools that are optimally chosen based on the available Spot capacity. If the allocation strategy is lowest-price, the Auto Scaling group launches instances using the Spot pools with the lowest price, and evenly allocates your instances across the number of Spot pools that you specify. Defaults to lowest-price if not specified.
        public let spotAllocationStrategy: String?
        /// The number of Spot Instance pools across which to allocate your Spot Instances. The Spot pools are determined from the different instance types in the overrides. Valid only when the Spot allocation strategy is lowest-price. Value must be in the range of 1 to 20. Defaults to 2 if not specified.
        public let spotInstancePools: Int?
        /// The maximum price per unit hour that you are willing to pay for a Spot Instance. If you leave the value at its default (empty), Amazon EC2 Auto Scaling uses the On-Demand price as the maximum Spot price. To remove a value that you previously set, include the property but specify an empty string ("") for the value.
        public let spotMaxPrice: String?

        public init(onDemandAllocationStrategy: String? = nil, onDemandBaseCapacity: Int? = nil, onDemandPercentageAboveBaseCapacity: Int? = nil, spotAllocationStrategy: String? = nil, spotInstancePools: Int? = nil, spotMaxPrice: String? = nil) {
            self.onDemandAllocationStrategy = onDemandAllocationStrategy
            self.onDemandBaseCapacity = onDemandBaseCapacity
            self.onDemandPercentageAboveBaseCapacity = onDemandPercentageAboveBaseCapacity
            self.spotAllocationStrategy = spotAllocationStrategy
            self.spotInstancePools = spotInstancePools
            self.spotMaxPrice = spotMaxPrice
        }

        public func validate(name: String) throws {
            try self.validate(self.onDemandAllocationStrategy, name: "onDemandAllocationStrategy", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.spotAllocationStrategy, name: "spotAllocationStrategy", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.spotMaxPrice, name: "spotMaxPrice", parent: name, max: 255)
            try self.validate(self.spotMaxPrice, name: "spotMaxPrice", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case onDemandAllocationStrategy = "OnDemandAllocationStrategy"
            case onDemandBaseCapacity = "OnDemandBaseCapacity"
            case onDemandPercentageAboveBaseCapacity = "OnDemandPercentageAboveBaseCapacity"
            case spotAllocationStrategy = "SpotAllocationStrategy"
            case spotInstancePools = "SpotInstancePools"
            case spotMaxPrice = "SpotMaxPrice"
        }
    }

    public struct LaunchConfiguration: AWSDecodableShape {
        /// For Auto Scaling groups that are running in a VPC, specifies whether to assign a public IP address to the group's instances. For more information, see Launching Auto Scaling instances in a VPC in the Amazon EC2 Auto Scaling User Guide.
        public let associatePublicIpAddress: Bool?
        /// A block device mapping, which specifies the block devices for the instance. For more information, see Block Device Mapping in the Amazon EC2 User Guide for Linux Instances.
        @OptionalCustomCoding<StandardArrayCoder>
        public var blockDeviceMappings: [BlockDeviceMapping]?
        /// The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. For more information, see ClassicLink in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic instances to a VPC in the Amazon EC2 Auto Scaling User Guide.
        public let classicLinkVPCId: String?
        /// The IDs of one or more security groups for the VPC specified in ClassicLinkVPCId. For more information, see ClassicLink in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic instances to a VPC in the Amazon EC2 Auto Scaling User Guide.
        @OptionalCustomCoding<StandardArrayCoder>
        public var classicLinkVPCSecurityGroups: [String]?
        /// The creation date and time for the launch configuration.
        public let createdTime: Date
        /// Specifies whether the launch configuration is optimized for EBS I/O (true) or not (false). For more information, see Amazon EBS-Optimized Instances in the Amazon EC2 User Guide for Linux Instances.
        public let ebsOptimized: Bool?
        /// The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. The instance profile contains the IAM role. For more information, see IAM role for applications that run on Amazon EC2 instances in the Amazon EC2 Auto Scaling User Guide.
        public let iamInstanceProfile: String?
        /// The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances. For more information, see Finding an AMI in the Amazon EC2 User Guide for Linux Instances.
        public let imageId: String
        /// Controls whether instances in this group are launched with detailed (true) or basic (false) monitoring. For more information, see Configure Monitoring for Auto Scaling Instances in the Amazon EC2 Auto Scaling User Guide.
        public let instanceMonitoring: InstanceMonitoring?
        /// The instance type for the instances. For information about available instance types, see Available Instance Types in the Amazon EC2 User Guide for Linux Instances.
        public let instanceType: String
        /// The ID of the kernel associated with the AMI.
        public let kernelId: String?
        /// The name of the key pair. For more information, see Amazon EC2 Key Pairs in the Amazon EC2 User Guide for Linux Instances.
        public let keyName: String?
        /// The Amazon Resource Name (ARN) of the launch configuration.
        public let launchConfigurationARN: String?
        /// The name of the launch configuration.
        public let launchConfigurationName: String
        /// The metadata options for the instances. For more information, see Configuring the Instance Metadata Options in the Amazon EC2 Auto Scaling User Guide.
        public let metadataOptions: InstanceMetadataOptions?
        /// The tenancy of the instance, either default or dedicated. An instance with dedicated tenancy runs on isolated, single-tenant hardware and can only be launched into a VPC. For more information, see Configuring instance tenancy with Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
        public let placementTenancy: String?
        /// The ID of the RAM disk associated with the AMI.
        public let ramdiskId: String?
        /// A list that contains the security groups to assign to the instances in the Auto Scaling group. For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide.
        @OptionalCustomCoding<StandardArrayCoder>
        public var securityGroups: [String]?
        /// The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot price. For more information, see Requesting Spot Instances in the Amazon EC2 Auto Scaling User Guide.
        public let spotPrice: String?
        /// The user data to make available to the launched EC2 instances. For more information, see Instance metadata and user data (Linux) and Instance metadata and user data (Windows). If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.
        public let userData: String?

        public init(associatePublicIpAddress: Bool? = nil, blockDeviceMappings: [BlockDeviceMapping]? = nil, classicLinkVPCId: String? = nil, classicLinkVPCSecurityGroups: [String]? = nil, createdTime: Date, ebsOptimized: Bool? = nil, iamInstanceProfile: String? = nil, imageId: String, instanceMonitoring: InstanceMonitoring? = nil, instanceType: String, kernelId: String? = nil, keyName: String? = nil, launchConfigurationARN: String? = nil, launchConfigurationName: String, metadataOptions: InstanceMetadataOptions? = nil, placementTenancy: String? = nil, ramdiskId: String? = nil, securityGroups: [String]? = nil, spotPrice: String? = nil, userData: String? = nil) {
            self.associatePublicIpAddress = associatePublicIpAddress
            self.blockDeviceMappings = blockDeviceMappings
            self.classicLinkVPCId = classicLinkVPCId
            self.classicLinkVPCSecurityGroups = classicLinkVPCSecurityGroups
            self.createdTime = createdTime
            self.ebsOptimized = ebsOptimized
            self.iamInstanceProfile = iamInstanceProfile
            self.imageId = imageId
            self.instanceMonitoring = instanceMonitoring
            self.instanceType = instanceType
            self.kernelId = kernelId
            self.keyName = keyName
            self.launchConfigurationARN = launchConfigurationARN
            self.launchConfigurationName = launchConfigurationName
            self.metadataOptions = metadataOptions
            self.placementTenancy = placementTenancy
            self.ramdiskId = ramdiskId
            self.securityGroups = securityGroups
            self.spotPrice = spotPrice
            self.userData = userData
        }

        private enum CodingKeys: String, CodingKey {
            case associatePublicIpAddress = "AssociatePublicIpAddress"
            case blockDeviceMappings = "BlockDeviceMappings"
            case classicLinkVPCId = "ClassicLinkVPCId"
            case classicLinkVPCSecurityGroups = "ClassicLinkVPCSecurityGroups"
            case createdTime = "CreatedTime"
            case ebsOptimized = "EbsOptimized"
            case iamInstanceProfile = "IamInstanceProfile"
            case imageId = "ImageId"
            case instanceMonitoring = "InstanceMonitoring"
            case instanceType = "InstanceType"
            case kernelId = "KernelId"
            case keyName = "KeyName"
            case launchConfigurationARN = "LaunchConfigurationARN"
            case launchConfigurationName = "LaunchConfigurationName"
            case metadataOptions = "MetadataOptions"
            case placementTenancy = "PlacementTenancy"
            case ramdiskId = "RamdiskId"
            case securityGroups = "SecurityGroups"
            case spotPrice = "SpotPrice"
            case userData = "UserData"
        }
    }

    public struct LaunchConfigurationNameType: AWSEncodableShape {
        /// The name of the launch configuration.
        public let launchConfigurationName: String

        public init(launchConfigurationName: String) {
            self.launchConfigurationName = launchConfigurationName
        }

        public func validate(name: String) throws {
            try self.validate(self.launchConfigurationName, name: "launchConfigurationName", parent: name, max: 255)
            try self.validate(self.launchConfigurationName, name: "launchConfigurationName", parent: name, min: 1)
            try self.validate(self.launchConfigurationName, name: "launchConfigurationName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case launchConfigurationName = "LaunchConfigurationName"
        }
    }

    public struct LaunchConfigurationNamesType: AWSEncodableShape {
        /// The launch configuration names. If you omit this parameter, all launch configurations are described.
        @OptionalCustomCoding<StandardArrayCoder>
        public var launchConfigurationNames: [String]?
        /// The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.
        public let maxRecords: Int?
        /// The token for the next set of items to return. (You received this token from a previous call.)
        public let nextToken: String?

        public init(launchConfigurationNames: [String]? = nil, maxRecords: Int? = nil, nextToken: String? = nil) {
            self.launchConfigurationNames = launchConfigurationNames
            self.maxRecords = maxRecords
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.launchConfigurationNames?.forEach {
                try validate($0, name: "launchConfigurationNames[]", parent: name, max: 255)
                try validate($0, name: "launchConfigurationNames[]", parent: name, min: 1)
                try validate($0, name: "launchConfigurationNames[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case launchConfigurationNames = "LaunchConfigurationNames"
            case maxRecords = "MaxRecords"
            case nextToken = "NextToken"
        }
    }

    public struct LaunchConfigurationsType: AWSDecodableShape {
        /// The launch configurations.
        @CustomCoding<StandardArrayCoder>
        public var launchConfigurations: [LaunchConfiguration]
        /// A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.
        public let nextToken: String?

        public init(launchConfigurations: [LaunchConfiguration], nextToken: String? = nil) {
            self.launchConfigurations = launchConfigurations
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case launchConfigurations = "LaunchConfigurations"
            case nextToken = "NextToken"
        }
    }

    public struct LaunchTemplate: AWSEncodableShape & AWSDecodableShape {
        /// The launch template to use.
        public let launchTemplateSpecification: LaunchTemplateSpecification?
        /// Any parameters that you specify override the same parameters in the launch template. If not provided, Amazon EC2 Auto Scaling uses the instance type specified in the launch template when it launches an instance.
        @OptionalCustomCoding<StandardArrayCoder>
        public var overrides: [LaunchTemplateOverrides]?

        public init(launchTemplateSpecification: LaunchTemplateSpecification? = nil, overrides: [LaunchTemplateOverrides]? = nil) {
            self.launchTemplateSpecification = launchTemplateSpecification
            self.overrides = overrides
        }

        public func validate(name: String) throws {
            try self.launchTemplateSpecification?.validate(name: "\(name).launchTemplateSpecification")
            try self.overrides?.forEach {
                try $0.validate(name: "\(name).overrides[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case launchTemplateSpecification = "LaunchTemplateSpecification"
            case overrides = "Overrides"
        }
    }

    public struct LaunchTemplateOverrides: AWSEncodableShape & AWSDecodableShape {
        /// The instance type, such as m3.xlarge. You must use an instance type that is supported in your requested Region and Availability Zones. For more information, see Instance types in the Amazon Elastic Compute Cloud User Guide.
        public let instanceType: String?
        /// Provides the launch template to be used when launching the instance type. For example, some instance types might require a launch template with a different AMI. If not provided, Amazon EC2 Auto Scaling uses the launch template that's defined for your mixed instances policy. For more information, see Specifying a different launch template for an instance type in the Amazon EC2 Auto Scaling User Guide.
        public let launchTemplateSpecification: LaunchTemplateSpecification?
        /// The number of capacity units provided by the specified instance type in terms of virtual CPUs, memory, storage, throughput, or other relative performance characteristic. When a Spot or On-Demand Instance is provisioned, the capacity units count toward the desired capacity. Amazon EC2 Auto Scaling provisions instances until the desired capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EC2 Auto Scaling can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the desired capacity is exceeded by 3 units. For more information, see Instance weighting for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. Value must be in the range of 1 to 999.
        public let weightedCapacity: String?

        public init(instanceType: String? = nil, launchTemplateSpecification: LaunchTemplateSpecification? = nil, weightedCapacity: String? = nil) {
            self.instanceType = instanceType
            self.launchTemplateSpecification = launchTemplateSpecification
            self.weightedCapacity = weightedCapacity
        }

        public func validate(name: String) throws {
            try self.validate(self.instanceType, name: "instanceType", parent: name, max: 255)
            try self.validate(self.instanceType, name: "instanceType", parent: name, min: 1)
            try self.validate(self.instanceType, name: "instanceType", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.launchTemplateSpecification?.validate(name: "\(name).launchTemplateSpecification")
            try self.validate(self.weightedCapacity, name: "weightedCapacity", parent: name, max: 32)
            try self.validate(self.weightedCapacity, name: "weightedCapacity", parent: name, min: 1)
            try self.validate(self.weightedCapacity, name: "weightedCapacity", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case instanceType = "InstanceType"
            case launchTemplateSpecification = "LaunchTemplateSpecification"
            case weightedCapacity = "WeightedCapacity"
        }
    }

    public struct LaunchTemplateSpecification: AWSEncodableShape & AWSDecodableShape {
        /// The ID of the launch template. To get the template ID, use the Amazon EC2 DescribeLaunchTemplates API operation. New launch templates can be created using the Amazon EC2 CreateLaunchTemplate API.  Conditional: You must specify either a LaunchTemplateId or a LaunchTemplateName.
        public let launchTemplateId: String?
        /// The name of the launch template. To get the template name, use the Amazon EC2 DescribeLaunchTemplates API operation. New launch templates can be created using the Amazon EC2 CreateLaunchTemplate API.  Conditional: You must specify either a LaunchTemplateId or a LaunchTemplateName.
        public let launchTemplateName: String?
        /// The version number, $Latest, or $Default. To get the version number, use the Amazon EC2 DescribeLaunchTemplateVersions API operation. New launch template versions can be created using the Amazon EC2 CreateLaunchTemplateVersion API. If the value is $Latest, Amazon EC2 Auto Scaling selects the latest version of the launch template when launching instances. If the value is $Default, Amazon EC2 Auto Scaling selects the default version of the launch template when launching instances. The default value is $Default.
        public let version: String?

        public init(launchTemplateId: String? = nil, launchTemplateName: String? = nil, version: String? = nil) {
            self.launchTemplateId = launchTemplateId
            self.launchTemplateName = launchTemplateName
            self.version = version
        }

        public func validate(name: String) throws {
            try self.validate(self.launchTemplateId, name: "launchTemplateId", parent: name, max: 255)
            try self.validate(self.launchTemplateId, name: "launchTemplateId", parent: name, min: 1)
            try self.validate(self.launchTemplateId, name: "launchTemplateId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.launchTemplateName, name: "launchTemplateName", parent: name, max: 128)
            try self.validate(self.launchTemplateName, name: "launchTemplateName", parent: name, min: 3)
            try self.validate(self.launchTemplateName, name: "launchTemplateName", parent: name, pattern: "[a-zA-Z0-9\\(\\)\\.\\-/_]+")
            try self.validate(self.version, name: "version", parent: name, max: 255)
            try self.validate(self.version, name: "version", parent: name, min: 1)
            try self.validate(self.version, name: "version", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case launchTemplateId = "LaunchTemplateId"
            case launchTemplateName = "LaunchTemplateName"
            case version = "Version"
        }
    }

    public struct LifecycleHook: AWSDecodableShape {
        /// The name of the Auto Scaling group for the lifecycle hook.
        public let autoScalingGroupName: String?
        /// Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The possible values are CONTINUE and ABANDON.
        public let defaultResult: String?
        /// The maximum time, in seconds, that an instance can remain in a Pending:Wait or Terminating:Wait state. The maximum is 172800 seconds (48 hours) or 100 times HeartbeatTimeout, whichever is smaller.
        public let globalTimeout: Int?
        /// The maximum time, in seconds, that can elapse before the lifecycle hook times out. If the lifecycle hook times out, Amazon EC2 Auto Scaling performs the action that you specified in the DefaultResult parameter.
        public let heartbeatTimeout: Int?
        /// The name of the lifecycle hook.
        public let lifecycleHookName: String?
        /// The state of the EC2 instance to which to attach the lifecycle hook. The following are possible values:   autoscaling:EC2_INSTANCE_LAUNCHING   autoscaling:EC2_INSTANCE_TERMINATING
        public let lifecycleTransition: String?
        /// Additional information that is included any time Amazon EC2 Auto Scaling sends a message to the notification target.
        public let notificationMetadata: String?
        /// The ARN of the target that Amazon EC2 Auto Scaling sends notifications to when an instance is in the transition state for the lifecycle hook. The notification target can be either an SQS queue or an SNS topic.
        public let notificationTargetARN: String?
        /// The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.
        public let roleARN: String?

        public init(autoScalingGroupName: String? = nil, defaultResult: String? = nil, globalTimeout: Int? = nil, heartbeatTimeout: Int? = nil, lifecycleHookName: String? = nil, lifecycleTransition: String? = nil, notificationMetadata: String? = nil, notificationTargetARN: String? = nil, roleARN: String? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.defaultResult = defaultResult
            self.globalTimeout = globalTimeout
            self.heartbeatTimeout = heartbeatTimeout
            self.lifecycleHookName = lifecycleHookName
            self.lifecycleTransition = lifecycleTransition
            self.notificationMetadata = notificationMetadata
            self.notificationTargetARN = notificationTargetARN
            self.roleARN = roleARN
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case defaultResult = "DefaultResult"
            case globalTimeout = "GlobalTimeout"
            case heartbeatTimeout = "HeartbeatTimeout"
            case lifecycleHookName = "LifecycleHookName"
            case lifecycleTransition = "LifecycleTransition"
            case notificationMetadata = "NotificationMetadata"
            case notificationTargetARN = "NotificationTargetARN"
            case roleARN = "RoleARN"
        }
    }

    public struct LifecycleHookSpecification: AWSEncodableShape {
        /// Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The valid values are CONTINUE and ABANDON. The default value is ABANDON.
        public let defaultResult: String?
        /// The maximum time, in seconds, that can elapse before the lifecycle hook times out. If the lifecycle hook times out, Amazon EC2 Auto Scaling performs the action that you specified in the DefaultResult parameter. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat.
        public let heartbeatTimeout: Int?
        /// The name of the lifecycle hook.
        public let lifecycleHookName: String
        /// The state of the EC2 instance to which you want to attach the lifecycle hook. The valid values are:   autoscaling:EC2_INSTANCE_LAUNCHING   autoscaling:EC2_INSTANCE_TERMINATING
        public let lifecycleTransition: String
        /// Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.
        public let notificationMetadata: String?
        /// The ARN of the target that Amazon EC2 Auto Scaling sends notifications to when an instance is in the transition state for the lifecycle hook. The notification target can be either an SQS queue or an SNS topic.
        public let notificationTargetARN: String?
        /// The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target, for example, an Amazon SNS topic or an Amazon SQS queue.
        public let roleARN: String?

        public init(defaultResult: String? = nil, heartbeatTimeout: Int? = nil, lifecycleHookName: String, lifecycleTransition: String, notificationMetadata: String? = nil, notificationTargetARN: String? = nil, roleARN: String? = nil) {
            self.defaultResult = defaultResult
            self.heartbeatTimeout = heartbeatTimeout
            self.lifecycleHookName = lifecycleHookName
            self.lifecycleTransition = lifecycleTransition
            self.notificationMetadata = notificationMetadata
            self.notificationTargetARN = notificationTargetARN
            self.roleARN = roleARN
        }

        public func validate(name: String) throws {
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, max: 255)
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, min: 1)
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, pattern: "[A-Za-z0-9\\-_\\/]+")
            try self.validate(self.notificationMetadata, name: "notificationMetadata", parent: name, max: 1023)
            try self.validate(self.notificationMetadata, name: "notificationMetadata", parent: name, min: 1)
            try self.validate(self.notificationMetadata, name: "notificationMetadata", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.notificationTargetARN, name: "notificationTargetARN", parent: name, max: 255)
            try self.validate(self.notificationTargetARN, name: "notificationTargetARN", parent: name, min: 0)
            try self.validate(self.notificationTargetARN, name: "notificationTargetARN", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.roleARN, name: "roleARN", parent: name, max: 255)
            try self.validate(self.roleARN, name: "roleARN", parent: name, min: 1)
            try self.validate(self.roleARN, name: "roleARN", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case defaultResult = "DefaultResult"
            case heartbeatTimeout = "HeartbeatTimeout"
            case lifecycleHookName = "LifecycleHookName"
            case lifecycleTransition = "LifecycleTransition"
            case notificationMetadata = "NotificationMetadata"
            case notificationTargetARN = "NotificationTargetARN"
            case roleARN = "RoleARN"
        }
    }

    public struct LoadBalancerState: AWSDecodableShape {
        /// The name of the load balancer.
        public let loadBalancerName: String?
        /// One of the following load balancer states:    Adding - The instances in the group are being registered with the load balancer.    Added - All instances in the group are registered with the load balancer.    InService - At least one instance in the group passed an ELB health check.    Removing - The instances in the group are being deregistered from the load balancer. If connection draining is enabled, Elastic Load Balancing waits for in-flight requests to complete before deregistering the instances.    Removed - All instances in the group are deregistered from the load balancer.
        public let state: String?

        public init(loadBalancerName: String? = nil, state: String? = nil) {
            self.loadBalancerName = loadBalancerName
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case loadBalancerName = "LoadBalancerName"
            case state = "State"
        }
    }

    public struct LoadBalancerTargetGroupState: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the target group.
        public let loadBalancerTargetGroupARN: String?
        /// The state of the target group.    Adding - The Auto Scaling instances are being registered with the target group.    Added - All Auto Scaling instances are registered with the target group.    InService - At least one Auto Scaling instance passed an ELB health check.    Removing - The Auto Scaling instances are being deregistered from the target group. If connection draining is enabled, Elastic Load Balancing waits for in-flight requests to complete before deregistering the instances.    Removed - All Auto Scaling instances are deregistered from the target group.
        public let state: String?

        public init(loadBalancerTargetGroupARN: String? = nil, state: String? = nil) {
            self.loadBalancerTargetGroupARN = loadBalancerTargetGroupARN
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case loadBalancerTargetGroupARN = "LoadBalancerTargetGroupARN"
            case state = "State"
        }
    }

    public struct MetricCollectionType: AWSDecodableShape {
        /// One of the following metrics:    GroupMinSize     GroupMaxSize     GroupDesiredCapacity     GroupInServiceInstances     GroupPendingInstances     GroupStandbyInstances     GroupTerminatingInstances     GroupTotalInstances     GroupInServiceCapacity     GroupPendingCapacity     GroupStandbyCapacity     GroupTerminatingCapacity     GroupTotalCapacity
        public let metric: String?

        public init(metric: String? = nil) {
            self.metric = metric
        }

        private enum CodingKeys: String, CodingKey {
            case metric = "Metric"
        }
    }

    public struct MetricDimension: AWSEncodableShape & AWSDecodableShape {
        /// The name of the dimension.
        public let name: String
        /// The value of the dimension.
        public let value: String

        public init(name: String, value: String) {
            self.name = name
            self.value = value
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case value = "Value"
        }
    }

    public struct MetricGranularityType: AWSDecodableShape {
        /// The granularity. The only valid value is 1Minute.
        public let granularity: String?

        public init(granularity: String? = nil) {
            self.granularity = granularity
        }

        private enum CodingKeys: String, CodingKey {
            case granularity = "Granularity"
        }
    }

    public struct MixedInstancesPolicy: AWSEncodableShape & AWSDecodableShape {
        /// Specifies the instances distribution. If not provided, the value for each parameter in InstancesDistribution uses a default value.
        public let instancesDistribution: InstancesDistribution?
        /// Specifies the launch template to use and optionally the instance types (overrides) that are used to provision EC2 instances to fulfill On-Demand and Spot capacities. Required when creating a mixed instances policy.
        public let launchTemplate: LaunchTemplate?

        public init(instancesDistribution: InstancesDistribution? = nil, launchTemplate: LaunchTemplate? = nil) {
            self.instancesDistribution = instancesDistribution
            self.launchTemplate = launchTemplate
        }

        public func validate(name: String) throws {
            try self.instancesDistribution?.validate(name: "\(name).instancesDistribution")
            try self.launchTemplate?.validate(name: "\(name).launchTemplate")
        }

        private enum CodingKeys: String, CodingKey {
            case instancesDistribution = "InstancesDistribution"
            case launchTemplate = "LaunchTemplate"
        }
    }

    public struct NotificationConfiguration: AWSDecodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String?
        /// One of the following event notification types:    autoscaling:EC2_INSTANCE_LAUNCH     autoscaling:EC2_INSTANCE_LAUNCH_ERROR     autoscaling:EC2_INSTANCE_TERMINATE     autoscaling:EC2_INSTANCE_TERMINATE_ERROR     autoscaling:TEST_NOTIFICATION
        public let notificationType: String?
        /// The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (Amazon SNS) topic.
        public let topicARN: String?

        public init(autoScalingGroupName: String? = nil, notificationType: String? = nil, topicARN: String? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.notificationType = notificationType
            self.topicARN = topicARN
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case notificationType = "NotificationType"
            case topicARN = "TopicARN"
        }
    }

    public struct PoliciesType: AWSDecodableShape {
        /// A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.
        public let nextToken: String?
        /// The scaling policies.
        @OptionalCustomCoding<StandardArrayCoder>
        public var scalingPolicies: [ScalingPolicy]?

        public init(nextToken: String? = nil, scalingPolicies: [ScalingPolicy]? = nil) {
            self.nextToken = nextToken
            self.scalingPolicies = scalingPolicies
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case scalingPolicies = "ScalingPolicies"
        }
    }

    public struct PolicyARNType: AWSDecodableShape {
        /// The CloudWatch alarms created for the target tracking scaling policy.
        @OptionalCustomCoding<StandardArrayCoder>
        public var alarms: [Alarm]?
        /// The Amazon Resource Name (ARN) of the policy.
        public let policyARN: String?

        public init(alarms: [Alarm]? = nil, policyARN: String? = nil) {
            self.alarms = alarms
            self.policyARN = policyARN
        }

        private enum CodingKeys: String, CodingKey {
            case alarms = "Alarms"
            case policyARN = "PolicyARN"
        }
    }

    public struct PredefinedMetricSpecification: AWSEncodableShape & AWSDecodableShape {
        /// The metric type. The following predefined metrics are available:    ASGAverageCPUUtilization - Average CPU utilization of the Auto Scaling group.    ASGAverageNetworkIn - Average number of bytes received on all network interfaces by the Auto Scaling group.    ASGAverageNetworkOut - Average number of bytes sent out on all network interfaces by the Auto Scaling group.    ALBRequestCountPerTarget - Number of requests completed per target in an Application Load Balancer target group.
        public let predefinedMetricType: MetricType
        /// Identifies the resource associated with the metric type. You can't specify a resource label unless the metric type is ALBRequestCountPerTarget and there is a target group attached to the Auto Scaling group. You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format is app/&lt;load-balancer-name&gt;/&lt;load-balancer-id&gt;/targetgroup/&lt;target-group-name&gt;/&lt;target-group-id&gt;, where:   app/&lt;load-balancer-name&gt;/&lt;load-balancer-id&gt; is the final portion of the load balancer ARN   targetgroup/&lt;target-group-name&gt;/&lt;target-group-id&gt; is the final portion of the target group ARN.   This is an example: app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d. To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.
        public let resourceLabel: String?

        public init(predefinedMetricType: MetricType, resourceLabel: String? = nil) {
            self.predefinedMetricType = predefinedMetricType
            self.resourceLabel = resourceLabel
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceLabel, name: "resourceLabel", parent: name, max: 1023)
            try self.validate(self.resourceLabel, name: "resourceLabel", parent: name, min: 1)
            try self.validate(self.resourceLabel, name: "resourceLabel", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case predefinedMetricType = "PredefinedMetricType"
            case resourceLabel = "ResourceLabel"
        }
    }

    public struct ProcessType: AWSDecodableShape {
        /// One of the following processes:    Launch     Terminate     AddToLoadBalancer     AlarmNotification     AZRebalance     HealthCheck     InstanceRefresh     ReplaceUnhealthy     ScheduledActions
        public let processName: String

        public init(processName: String) {
            self.processName = processName
        }

        private enum CodingKeys: String, CodingKey {
            case processName = "ProcessName"
        }
    }

    public struct ProcessesType: AWSDecodableShape {
        /// The names of the process types.
        @OptionalCustomCoding<StandardArrayCoder>
        public var processes: [ProcessType]?

        public init(processes: [ProcessType]? = nil) {
            self.processes = processes
        }

        private enum CodingKeys: String, CodingKey {
            case processes = "Processes"
        }
    }

    public struct PutLifecycleHookAnswer: AWSDecodableShape {
        public init() {}
    }

    public struct PutLifecycleHookType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. This parameter can be either CONTINUE or ABANDON. The default value is ABANDON.
        public let defaultResult: String?
        /// The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from 30 to 7200 seconds. The default value is 3600 seconds (1 hour). If the lifecycle hook times out, Amazon EC2 Auto Scaling performs the action that you specified in the DefaultResult parameter. You can prevent the lifecycle hook from timing out by calling the RecordLifecycleActionHeartbeat API.
        public let heartbeatTimeout: Int?
        /// The name of the lifecycle hook.
        public let lifecycleHookName: String
        /// The instance state to which you want to attach the lifecycle hook. The valid values are:   autoscaling:EC2_INSTANCE_LAUNCHING   autoscaling:EC2_INSTANCE_TERMINATING   Required for new lifecycle hooks, but optional when updating existing hooks.
        public let lifecycleTransition: String?
        /// Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.
        public let notificationMetadata: String?
        /// The ARN of the notification target that Amazon EC2 Auto Scaling uses to notify you when an instance is in the transition state for the lifecycle hook. This target can be either an SQS queue or an SNS topic. If you specify an empty string, this overrides the current ARN. This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email key-value pair format when sending notifications to an Amazon SNS topic. When you specify a notification target, Amazon EC2 Auto Scaling sends it a test message. Test messages contain the following additional key-value pair: "Event": "autoscaling:TEST_NOTIFICATION".
        public let notificationTargetARN: String?
        /// The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target, for example, an Amazon SNS topic or an Amazon SQS queue. Required for new lifecycle hooks, but optional when updating existing hooks.
        public let roleARN: String?

        public init(autoScalingGroupName: String, defaultResult: String? = nil, heartbeatTimeout: Int? = nil, lifecycleHookName: String, lifecycleTransition: String? = nil, notificationMetadata: String? = nil, notificationTargetARN: String? = nil, roleARN: String? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.defaultResult = defaultResult
            self.heartbeatTimeout = heartbeatTimeout
            self.lifecycleHookName = lifecycleHookName
            self.lifecycleTransition = lifecycleTransition
            self.notificationMetadata = notificationMetadata
            self.notificationTargetARN = notificationTargetARN
            self.roleARN = roleARN
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, max: 255)
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, min: 1)
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, pattern: "[A-Za-z0-9\\-_\\/]+")
            try self.validate(self.notificationMetadata, name: "notificationMetadata", parent: name, max: 1023)
            try self.validate(self.notificationMetadata, name: "notificationMetadata", parent: name, min: 1)
            try self.validate(self.notificationMetadata, name: "notificationMetadata", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.notificationTargetARN, name: "notificationTargetARN", parent: name, max: 255)
            try self.validate(self.notificationTargetARN, name: "notificationTargetARN", parent: name, min: 0)
            try self.validate(self.notificationTargetARN, name: "notificationTargetARN", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.roleARN, name: "roleARN", parent: name, max: 255)
            try self.validate(self.roleARN, name: "roleARN", parent: name, min: 1)
            try self.validate(self.roleARN, name: "roleARN", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case defaultResult = "DefaultResult"
            case heartbeatTimeout = "HeartbeatTimeout"
            case lifecycleHookName = "LifecycleHookName"
            case lifecycleTransition = "LifecycleTransition"
            case notificationMetadata = "NotificationMetadata"
            case notificationTargetARN = "NotificationTargetARN"
            case roleARN = "RoleARN"
        }
    }

    public struct PutNotificationConfigurationType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The type of event that causes the notification to be sent. To query the notification types supported by Amazon EC2 Auto Scaling, call the DescribeAutoScalingNotificationTypes API.
        @CustomCoding<StandardArrayCoder>
        public var notificationTypes: [String]
        /// The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (Amazon SNS) topic.
        public let topicARN: String

        public init(autoScalingGroupName: String, notificationTypes: [String], topicARN: String) {
            self.autoScalingGroupName = autoScalingGroupName
            self.notificationTypes = notificationTypes
            self.topicARN = topicARN
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.notificationTypes.forEach {
                try validate($0, name: "notificationTypes[]", parent: name, max: 255)
                try validate($0, name: "notificationTypes[]", parent: name, min: 1)
                try validate($0, name: "notificationTypes[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.topicARN, name: "topicARN", parent: name, max: 255)
            try self.validate(self.topicARN, name: "topicARN", parent: name, min: 1)
            try self.validate(self.topicARN, name: "topicARN", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case notificationTypes = "NotificationTypes"
            case topicARN = "TopicARN"
        }
    }

    public struct PutScalingPolicyType: AWSEncodableShape {
        /// Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity. Required if the policy type is StepScaling or SimpleScaling. For more information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
        public let adjustmentType: String?
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The duration of the policy's cooldown period, in seconds. When a cooldown period is specified here, it overrides the default cooldown period defined for the Auto Scaling group. Valid only if the policy type is SimpleScaling. For more information, see Scaling cooldowns for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
        public let cooldown: Int?
        /// Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, see Disabling a scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
        public let enabled: Bool?
        /// The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. If not provided, the default is to use the value from the default cooldown period for the Auto Scaling group. Valid only if the policy type is TargetTrackingScaling or StepScaling.
        public let estimatedInstanceWarmup: Int?
        /// The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average. Valid only if the policy type is StepScaling.
        public let metricAggregationType: String?
        /// The minimum value to scale by when the adjustment type is PercentChangeInCapacity. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances. Valid only if the policy type is StepScaling or SimpleScaling. For more information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.  Some Auto Scaling groups use instance weights. In this case, set the MinAdjustmentMagnitude to a value that is at least as large as your largest instance weight.
        public let minAdjustmentMagnitude: Int?
        /// Available for backward compatibility. Use MinAdjustmentMagnitude instead.
        public let minAdjustmentStep: Int?
        /// The name of the policy.
        public let policyName: String
        /// One of the following policy types:     TargetTrackingScaling     StepScaling     SimpleScaling (default)
        public let policyType: String?
        /// The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a positive value. Required if the policy type is SimpleScaling. (Not used with any other policy type.)
        public let scalingAdjustment: Int?
        /// A set of adjustments that enable you to scale based on the size of the alarm breach. Required if the policy type is StepScaling. (Not used with any other policy type.)
        @OptionalCustomCoding<StandardArrayCoder>
        public var stepAdjustments: [StepAdjustment]?
        /// A target tracking scaling policy. Includes support for predefined or customized metrics. The following predefined metrics are available:    ASGAverageCPUUtilization     ASGAverageNetworkIn     ASGAverageNetworkOut     ALBRequestCountPerTarget    If you specify ALBRequestCountPerTarget for the metric, you must specify the ResourceLabel parameter with the PredefinedMetricSpecification. For more information, see TargetTrackingConfiguration in the Amazon EC2 Auto Scaling API Reference. Required if the policy type is TargetTrackingScaling.
        public let targetTrackingConfiguration: TargetTrackingConfiguration?

        public init(adjustmentType: String? = nil, autoScalingGroupName: String, cooldown: Int? = nil, enabled: Bool? = nil, estimatedInstanceWarmup: Int? = nil, metricAggregationType: String? = nil, minAdjustmentMagnitude: Int? = nil, minAdjustmentStep: Int? = nil, policyName: String, policyType: String? = nil, scalingAdjustment: Int? = nil, stepAdjustments: [StepAdjustment]? = nil, targetTrackingConfiguration: TargetTrackingConfiguration? = nil) {
            self.adjustmentType = adjustmentType
            self.autoScalingGroupName = autoScalingGroupName
            self.cooldown = cooldown
            self.enabled = enabled
            self.estimatedInstanceWarmup = estimatedInstanceWarmup
            self.metricAggregationType = metricAggregationType
            self.minAdjustmentMagnitude = minAdjustmentMagnitude
            self.minAdjustmentStep = minAdjustmentStep
            self.policyName = policyName
            self.policyType = policyType
            self.scalingAdjustment = scalingAdjustment
            self.stepAdjustments = stepAdjustments
            self.targetTrackingConfiguration = targetTrackingConfiguration
        }

        public func validate(name: String) throws {
            try self.validate(self.adjustmentType, name: "adjustmentType", parent: name, max: 255)
            try self.validate(self.adjustmentType, name: "adjustmentType", parent: name, min: 1)
            try self.validate(self.adjustmentType, name: "adjustmentType", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.metricAggregationType, name: "metricAggregationType", parent: name, max: 32)
            try self.validate(self.metricAggregationType, name: "metricAggregationType", parent: name, min: 1)
            try self.validate(self.metricAggregationType, name: "metricAggregationType", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.policyName, name: "policyName", parent: name, max: 255)
            try self.validate(self.policyName, name: "policyName", parent: name, min: 1)
            try self.validate(self.policyName, name: "policyName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.policyType, name: "policyType", parent: name, max: 64)
            try self.validate(self.policyType, name: "policyType", parent: name, min: 1)
            try self.validate(self.policyType, name: "policyType", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.targetTrackingConfiguration?.validate(name: "\(name).targetTrackingConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case adjustmentType = "AdjustmentType"
            case autoScalingGroupName = "AutoScalingGroupName"
            case cooldown = "Cooldown"
            case enabled = "Enabled"
            case estimatedInstanceWarmup = "EstimatedInstanceWarmup"
            case metricAggregationType = "MetricAggregationType"
            case minAdjustmentMagnitude = "MinAdjustmentMagnitude"
            case minAdjustmentStep = "MinAdjustmentStep"
            case policyName = "PolicyName"
            case policyType = "PolicyType"
            case scalingAdjustment = "ScalingAdjustment"
            case stepAdjustments = "StepAdjustments"
            case targetTrackingConfiguration = "TargetTrackingConfiguration"
        }
    }

    public struct PutScheduledUpdateGroupActionType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain. It can scale beyond this capacity if you add more scaling conditions.
        public let desiredCapacity: Int?
        /// The date and time for the recurring schedule to end. Amazon EC2 Auto Scaling does not perform the action after this time.
        public let endTime: Date?
        /// The maximum size of the Auto Scaling group.
        public let maxSize: Int?
        /// The minimum size of the Auto Scaling group.
        public let minSize: Int?
        /// The recurring schedule for this action, in Unix cron syntax format. This format consists of five fields separated by white spaces: [Minute] [Hour] [Day_of_Month] [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example, "30 0 1 1,6,12 *"). For more information about this format, see Crontab. When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action starts and stops.
        public let recurrence: String?
        /// The name of this scaling action.
        public let scheduledActionName: String
        /// The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example, "2019-06-01T00:00:00Z"). If you specify Recurrence and StartTime, Amazon EC2 Auto Scaling performs the action at this time, and then performs the action based on the specified recurrence. If you try to schedule your action in the past, Amazon EC2 Auto Scaling returns an error message.
        public let startTime: Date?
        /// This parameter is no longer used.
        public let time: Date?

        public init(autoScalingGroupName: String, desiredCapacity: Int? = nil, endTime: Date? = nil, maxSize: Int? = nil, minSize: Int? = nil, recurrence: String? = nil, scheduledActionName: String, startTime: Date? = nil, time: Date? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.desiredCapacity = desiredCapacity
            self.endTime = endTime
            self.maxSize = maxSize
            self.minSize = minSize
            self.recurrence = recurrence
            self.scheduledActionName = scheduledActionName
            self.startTime = startTime
            self.time = time
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.recurrence, name: "recurrence", parent: name, max: 255)
            try self.validate(self.recurrence, name: "recurrence", parent: name, min: 1)
            try self.validate(self.recurrence, name: "recurrence", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.scheduledActionName, name: "scheduledActionName", parent: name, max: 255)
            try self.validate(self.scheduledActionName, name: "scheduledActionName", parent: name, min: 1)
            try self.validate(self.scheduledActionName, name: "scheduledActionName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case desiredCapacity = "DesiredCapacity"
            case endTime = "EndTime"
            case maxSize = "MaxSize"
            case minSize = "MinSize"
            case recurrence = "Recurrence"
            case scheduledActionName = "ScheduledActionName"
            case startTime = "StartTime"
            case time = "Time"
        }
    }

    public struct RecordLifecycleActionHeartbeatAnswer: AWSDecodableShape {
        public init() {}
    }

    public struct RecordLifecycleActionHeartbeatType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The ID of the instance.
        public let instanceId: String?
        /// A token that uniquely identifies a specific lifecycle action associated with an instance. Amazon EC2 Auto Scaling sends this token to the notification target that you specified when you created the lifecycle hook.
        public let lifecycleActionToken: String?
        /// The name of the lifecycle hook.
        public let lifecycleHookName: String

        public init(autoScalingGroupName: String, instanceId: String? = nil, lifecycleActionToken: String? = nil, lifecycleHookName: String) {
            self.autoScalingGroupName = autoScalingGroupName
            self.instanceId = instanceId
            self.lifecycleActionToken = lifecycleActionToken
            self.lifecycleHookName = lifecycleHookName
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 1600)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.instanceId, name: "instanceId", parent: name, max: 19)
            try self.validate(self.instanceId, name: "instanceId", parent: name, min: 1)
            try self.validate(self.instanceId, name: "instanceId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.lifecycleActionToken, name: "lifecycleActionToken", parent: name, max: 36)
            try self.validate(self.lifecycleActionToken, name: "lifecycleActionToken", parent: name, min: 36)
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, max: 255)
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, min: 1)
            try self.validate(self.lifecycleHookName, name: "lifecycleHookName", parent: name, pattern: "[A-Za-z0-9\\-_\\/]+")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case instanceId = "InstanceId"
            case lifecycleActionToken = "LifecycleActionToken"
            case lifecycleHookName = "LifecycleHookName"
        }
    }

    public struct RefreshPreferences: AWSEncodableShape {
        /// The number of seconds until a newly launched instance is configured and ready to use. During this time, Amazon EC2 Auto Scaling does not immediately move on to the next replacement. The default is to use the value for the health check grace period defined for the group.
        public let instanceWarmup: Int?
        /// The amount of capacity in the Auto Scaling group that must remain healthy during an instance refresh to allow the operation to continue, as a percentage of the desired capacity of the Auto Scaling group (rounded up to the nearest integer). The default is 90.
        public let minHealthyPercentage: Int?

        public init(instanceWarmup: Int? = nil, minHealthyPercentage: Int? = nil) {
            self.instanceWarmup = instanceWarmup
            self.minHealthyPercentage = minHealthyPercentage
        }

        public func validate(name: String) throws {
            try self.validate(self.instanceWarmup, name: "instanceWarmup", parent: name, min: 0)
            try self.validate(self.minHealthyPercentage, name: "minHealthyPercentage", parent: name, max: 100)
            try self.validate(self.minHealthyPercentage, name: "minHealthyPercentage", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case instanceWarmup = "InstanceWarmup"
            case minHealthyPercentage = "MinHealthyPercentage"
        }
    }

    public struct ScalingPolicy: AWSDecodableShape {
        /// Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
        public let adjustmentType: String?
        /// The CloudWatch alarms related to the policy.
        @OptionalCustomCoding<StandardArrayCoder>
        public var alarms: [Alarm]?
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String?
        /// The duration of the policy's cooldown period, in seconds.
        public let cooldown: Int?
        /// Indicates whether the policy is enabled (true) or disabled (false).
        public let enabled: Bool?
        /// The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.
        public let estimatedInstanceWarmup: Int?
        /// The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average.
        public let metricAggregationType: String?
        /// The minimum value to scale by when the adjustment type is PercentChangeInCapacity.
        public let minAdjustmentMagnitude: Int?
        /// Available for backward compatibility. Use MinAdjustmentMagnitude instead.
        public let minAdjustmentStep: Int?
        /// The Amazon Resource Name (ARN) of the policy.
        public let policyARN: String?
        /// The name of the scaling policy.
        public let policyName: String?
        /// One of the following policy types:     TargetTrackingScaling     StepScaling     SimpleScaling (default)   For more information, see Target tracking scaling policies and Step and simple scaling policies in the Amazon EC2 Auto Scaling User Guide.
        public let policyType: String?
        /// The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity.
        public let scalingAdjustment: Int?
        /// A set of adjustments that enable you to scale based on the size of the alarm breach.
        @OptionalCustomCoding<StandardArrayCoder>
        public var stepAdjustments: [StepAdjustment]?
        /// A target tracking scaling policy.
        public let targetTrackingConfiguration: TargetTrackingConfiguration?

        public init(adjustmentType: String? = nil, alarms: [Alarm]? = nil, autoScalingGroupName: String? = nil, cooldown: Int? = nil, enabled: Bool? = nil, estimatedInstanceWarmup: Int? = nil, metricAggregationType: String? = nil, minAdjustmentMagnitude: Int? = nil, minAdjustmentStep: Int? = nil, policyARN: String? = nil, policyName: String? = nil, policyType: String? = nil, scalingAdjustment: Int? = nil, stepAdjustments: [StepAdjustment]? = nil, targetTrackingConfiguration: TargetTrackingConfiguration? = nil) {
            self.adjustmentType = adjustmentType
            self.alarms = alarms
            self.autoScalingGroupName = autoScalingGroupName
            self.cooldown = cooldown
            self.enabled = enabled
            self.estimatedInstanceWarmup = estimatedInstanceWarmup
            self.metricAggregationType = metricAggregationType
            self.minAdjustmentMagnitude = minAdjustmentMagnitude
            self.minAdjustmentStep = minAdjustmentStep
            self.policyARN = policyARN
            self.policyName = policyName
            self.policyType = policyType
            self.scalingAdjustment = scalingAdjustment
            self.stepAdjustments = stepAdjustments
            self.targetTrackingConfiguration = targetTrackingConfiguration
        }

        private enum CodingKeys: String, CodingKey {
            case adjustmentType = "AdjustmentType"
            case alarms = "Alarms"
            case autoScalingGroupName = "AutoScalingGroupName"
            case cooldown = "Cooldown"
            case enabled = "Enabled"
            case estimatedInstanceWarmup = "EstimatedInstanceWarmup"
            case metricAggregationType = "MetricAggregationType"
            case minAdjustmentMagnitude = "MinAdjustmentMagnitude"
            case minAdjustmentStep = "MinAdjustmentStep"
            case policyARN = "PolicyARN"
            case policyName = "PolicyName"
            case policyType = "PolicyType"
            case scalingAdjustment = "ScalingAdjustment"
            case stepAdjustments = "StepAdjustments"
            case targetTrackingConfiguration = "TargetTrackingConfiguration"
        }
    }

    public struct ScalingProcessQuery: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// One or more of the following processes:    Launch     Terminate     AddToLoadBalancer     AlarmNotification     AZRebalance     HealthCheck     InstanceRefresh     ReplaceUnhealthy     ScheduledActions    If you omit this parameter, all processes are specified.
        @OptionalCustomCoding<StandardArrayCoder>
        public var scalingProcesses: [String]?

        public init(autoScalingGroupName: String, scalingProcesses: [String]? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.scalingProcesses = scalingProcesses
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.scalingProcesses?.forEach {
                try validate($0, name: "scalingProcesses[]", parent: name, max: 255)
                try validate($0, name: "scalingProcesses[]", parent: name, min: 1)
                try validate($0, name: "scalingProcesses[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case scalingProcesses = "ScalingProcesses"
        }
    }

    public struct ScheduledActionsType: AWSDecodableShape {
        /// A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.
        public let nextToken: String?
        /// The scheduled actions.
        @OptionalCustomCoding<StandardArrayCoder>
        public var scheduledUpdateGroupActions: [ScheduledUpdateGroupAction]?

        public init(nextToken: String? = nil, scheduledUpdateGroupActions: [ScheduledUpdateGroupAction]? = nil) {
            self.nextToken = nextToken
            self.scheduledUpdateGroupActions = scheduledUpdateGroupActions
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case scheduledUpdateGroupActions = "ScheduledUpdateGroupActions"
        }
    }

    public struct ScheduledUpdateGroupAction: AWSDecodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String?
        /// The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain.
        public let desiredCapacity: Int?
        /// The date and time in UTC for the recurring schedule to end. For example, "2019-06-01T00:00:00Z".
        public let endTime: Date?
        /// The maximum size of the Auto Scaling group.
        public let maxSize: Int?
        /// The minimum size of the Auto Scaling group.
        public let minSize: Int?
        /// The recurring schedule for the action, in Unix cron syntax format. When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action starts and stops.
        public let recurrence: String?
        /// The Amazon Resource Name (ARN) of the scheduled action.
        public let scheduledActionARN: String?
        /// The name of the scheduled action.
        public let scheduledActionName: String?
        /// The date and time in UTC for this action to start. For example, "2019-06-01T00:00:00Z".
        public let startTime: Date?
        /// This parameter is no longer used.
        public let time: Date?

        public init(autoScalingGroupName: String? = nil, desiredCapacity: Int? = nil, endTime: Date? = nil, maxSize: Int? = nil, minSize: Int? = nil, recurrence: String? = nil, scheduledActionARN: String? = nil, scheduledActionName: String? = nil, startTime: Date? = nil, time: Date? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.desiredCapacity = desiredCapacity
            self.endTime = endTime
            self.maxSize = maxSize
            self.minSize = minSize
            self.recurrence = recurrence
            self.scheduledActionARN = scheduledActionARN
            self.scheduledActionName = scheduledActionName
            self.startTime = startTime
            self.time = time
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case desiredCapacity = "DesiredCapacity"
            case endTime = "EndTime"
            case maxSize = "MaxSize"
            case minSize = "MinSize"
            case recurrence = "Recurrence"
            case scheduledActionARN = "ScheduledActionARN"
            case scheduledActionName = "ScheduledActionName"
            case startTime = "StartTime"
            case time = "Time"
        }
    }

    public struct ScheduledUpdateGroupActionRequest: AWSEncodableShape {
        /// The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain.
        public let desiredCapacity: Int?
        /// The date and time for the recurring schedule to end. Amazon EC2 Auto Scaling does not perform the action after this time.
        public let endTime: Date?
        /// The maximum size of the Auto Scaling group.
        public let maxSize: Int?
        /// The minimum size of the Auto Scaling group.
        public let minSize: Int?
        /// The recurring schedule for the action, in Unix cron syntax format. This format consists of five fields separated by white spaces: [Minute] [Hour] [Day_of_Month] [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example, "30 0 1 1,6,12 *"). For more information about this format, see Crontab. When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action starts and stops.
        public let recurrence: String?
        /// The name of the scaling action.
        public let scheduledActionName: String
        /// The date and time for the action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example, "2019-06-01T00:00:00Z"). If you specify Recurrence and StartTime, Amazon EC2 Auto Scaling performs the action at this time, and then performs the action based on the specified recurrence. If you try to schedule the action in the past, Amazon EC2 Auto Scaling returns an error message.
        public let startTime: Date?

        public init(desiredCapacity: Int? = nil, endTime: Date? = nil, maxSize: Int? = nil, minSize: Int? = nil, recurrence: String? = nil, scheduledActionName: String, startTime: Date? = nil) {
            self.desiredCapacity = desiredCapacity
            self.endTime = endTime
            self.maxSize = maxSize
            self.minSize = minSize
            self.recurrence = recurrence
            self.scheduledActionName = scheduledActionName
            self.startTime = startTime
        }

        public func validate(name: String) throws {
            try self.validate(self.recurrence, name: "recurrence", parent: name, max: 255)
            try self.validate(self.recurrence, name: "recurrence", parent: name, min: 1)
            try self.validate(self.recurrence, name: "recurrence", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.scheduledActionName, name: "scheduledActionName", parent: name, max: 255)
            try self.validate(self.scheduledActionName, name: "scheduledActionName", parent: name, min: 1)
            try self.validate(self.scheduledActionName, name: "scheduledActionName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case desiredCapacity = "DesiredCapacity"
            case endTime = "EndTime"
            case maxSize = "MaxSize"
            case minSize = "MinSize"
            case recurrence = "Recurrence"
            case scheduledActionName = "ScheduledActionName"
            case startTime = "StartTime"
        }
    }

    public struct SetDesiredCapacityType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// The desired capacity is the initial capacity of the Auto Scaling group after this operation completes and the capacity it attempts to maintain.
        public let desiredCapacity: Int
        /// Indicates whether Amazon EC2 Auto Scaling waits for the cooldown period to complete before initiating a scaling activity to set your Auto Scaling group to its new capacity. By default, Amazon EC2 Auto Scaling does not honor the cooldown period during manual scaling activities.
        public let honorCooldown: Bool?

        public init(autoScalingGroupName: String, desiredCapacity: Int, honorCooldown: Bool? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.desiredCapacity = desiredCapacity
            self.honorCooldown = honorCooldown
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case desiredCapacity = "DesiredCapacity"
            case honorCooldown = "HonorCooldown"
        }
    }

    public struct SetInstanceHealthQuery: AWSEncodableShape {
        /// The health status of the instance. Set to Healthy to have the instance remain in service. Set to Unhealthy to have the instance be out of service. Amazon EC2 Auto Scaling terminates and replaces the unhealthy instance.
        public let healthStatus: String
        /// The ID of the instance.
        public let instanceId: String
        /// If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call respects the grace period. Set this to False, to have the call not respect the grace period associated with the group. For more information about the health check grace period, see CreateAutoScalingGroup in the Amazon EC2 Auto Scaling API Reference.
        public let shouldRespectGracePeriod: Bool?

        public init(healthStatus: String, instanceId: String, shouldRespectGracePeriod: Bool? = nil) {
            self.healthStatus = healthStatus
            self.instanceId = instanceId
            self.shouldRespectGracePeriod = shouldRespectGracePeriod
        }

        public func validate(name: String) throws {
            try self.validate(self.healthStatus, name: "healthStatus", parent: name, max: 32)
            try self.validate(self.healthStatus, name: "healthStatus", parent: name, min: 1)
            try self.validate(self.healthStatus, name: "healthStatus", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.instanceId, name: "instanceId", parent: name, max: 19)
            try self.validate(self.instanceId, name: "instanceId", parent: name, min: 1)
            try self.validate(self.instanceId, name: "instanceId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case healthStatus = "HealthStatus"
            case instanceId = "InstanceId"
            case shouldRespectGracePeriod = "ShouldRespectGracePeriod"
        }
    }

    public struct SetInstanceProtectionAnswer: AWSDecodableShape {
        public init() {}
    }

    public struct SetInstanceProtectionQuery: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// One or more instance IDs. You can specify up to 50 instances.
        @CustomCoding<StandardArrayCoder>
        public var instanceIds: [String]
        /// Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in.
        public let protectedFromScaleIn: Bool

        public init(autoScalingGroupName: String, instanceIds: [String], protectedFromScaleIn: Bool) {
            self.autoScalingGroupName = autoScalingGroupName
            self.instanceIds = instanceIds
            self.protectedFromScaleIn = protectedFromScaleIn
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.instanceIds.forEach {
                try validate($0, name: "instanceIds[]", parent: name, max: 19)
                try validate($0, name: "instanceIds[]", parent: name, min: 1)
                try validate($0, name: "instanceIds[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case instanceIds = "InstanceIds"
            case protectedFromScaleIn = "ProtectedFromScaleIn"
        }
    }

    public struct StartInstanceRefreshAnswer: AWSDecodableShape {
        /// A unique ID for tracking the progress of the request.
        public let instanceRefreshId: String?

        public init(instanceRefreshId: String? = nil) {
            self.instanceRefreshId = instanceRefreshId
        }

        private enum CodingKeys: String, CodingKey {
            case instanceRefreshId = "InstanceRefreshId"
        }
    }

    public struct StartInstanceRefreshType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// Set of preferences associated with the instance refresh request. If not provided, the default values are used. For MinHealthyPercentage, the default value is 90. For InstanceWarmup, the default is to use the value specified for the health check grace period for the Auto Scaling group. For more information, see RefreshPreferences in the Amazon EC2 Auto Scaling API Reference.
        public let preferences: RefreshPreferences?
        /// The strategy to use for the instance refresh. The only valid value is Rolling. A rolling update is an update that is applied to all instances in an Auto Scaling group until all instances have been updated. A rolling update can fail due to failed health checks or if instances are on standby or are protected from scale in. If the rolling update process fails, any instances that were already replaced are not rolled back to their previous configuration.
        public let strategy: RefreshStrategy?

        public init(autoScalingGroupName: String, preferences: RefreshPreferences? = nil, strategy: RefreshStrategy? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.preferences = preferences
            self.strategy = strategy
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.preferences?.validate(name: "\(name).preferences")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case preferences = "Preferences"
            case strategy = "Strategy"
        }
    }

    public struct StepAdjustment: AWSEncodableShape & AWSDecodableShape {
        /// The lower bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the lower bound is inclusive (the metric must be greater than or equal to the threshold plus the lower bound). Otherwise, it is exclusive (the metric must be greater than the threshold plus the lower bound). A null value indicates negative infinity.
        public let metricIntervalLowerBound: Double?
        /// The upper bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the upper bound is exclusive (the metric must be less than the threshold plus the upper bound). Otherwise, it is inclusive (the metric must be less than or equal to the threshold plus the upper bound). A null value indicates positive infinity. The upper bound must be greater than the lower bound.
        public let metricIntervalUpperBound: Double?
        /// The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity.
        public let scalingAdjustment: Int

        public init(metricIntervalLowerBound: Double? = nil, metricIntervalUpperBound: Double? = nil, scalingAdjustment: Int) {
            self.metricIntervalLowerBound = metricIntervalLowerBound
            self.metricIntervalUpperBound = metricIntervalUpperBound
            self.scalingAdjustment = scalingAdjustment
        }

        private enum CodingKeys: String, CodingKey {
            case metricIntervalLowerBound = "MetricIntervalLowerBound"
            case metricIntervalUpperBound = "MetricIntervalUpperBound"
            case scalingAdjustment = "ScalingAdjustment"
        }
    }

    public struct SuspendedProcess: AWSDecodableShape {
        /// The name of the suspended process.
        public let processName: String?
        /// The reason that the process was suspended.
        public let suspensionReason: String?

        public init(processName: String? = nil, suspensionReason: String? = nil) {
            self.processName = processName
            self.suspensionReason = suspensionReason
        }

        private enum CodingKeys: String, CodingKey {
            case processName = "ProcessName"
            case suspensionReason = "SuspensionReason"
        }
    }

    public struct Tag: AWSEncodableShape {
        /// The tag key.
        public let key: String
        /// Determines whether the tag is added to new instances as they are launched in the group.
        public let propagateAtLaunch: Bool?
        /// The name of the group.
        public let resourceId: String?
        /// The type of resource. The only supported value is auto-scaling-group.
        public let resourceType: String?
        /// The tag value.
        public let value: String?

        public init(key: String, propagateAtLaunch: Bool? = nil, resourceId: String? = nil, resourceType: String? = nil, value: String? = nil) {
            self.key = key
            self.propagateAtLaunch = propagateAtLaunch
            self.resourceId = resourceId
            self.resourceType = resourceType
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.key, name: "key", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.resourceId, name: "resourceId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.resourceType, name: "resourceType", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.value, name: "value", parent: name, max: 256)
            try self.validate(self.value, name: "value", parent: name, min: 0)
            try self.validate(self.value, name: "value", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case propagateAtLaunch = "PropagateAtLaunch"
            case resourceId = "ResourceId"
            case resourceType = "ResourceType"
            case value = "Value"
        }
    }

    public struct TagDescription: AWSDecodableShape {
        /// The tag key.
        public let key: String?
        /// Determines whether the tag is added to new instances as they are launched in the group.
        public let propagateAtLaunch: Bool?
        /// The name of the group.
        public let resourceId: String?
        /// The type of resource. The only supported value is auto-scaling-group.
        public let resourceType: String?
        /// The tag value.
        public let value: String?

        public init(key: String? = nil, propagateAtLaunch: Bool? = nil, resourceId: String? = nil, resourceType: String? = nil, value: String? = nil) {
            self.key = key
            self.propagateAtLaunch = propagateAtLaunch
            self.resourceId = resourceId
            self.resourceType = resourceType
            self.value = value
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case propagateAtLaunch = "PropagateAtLaunch"
            case resourceId = "ResourceId"
            case resourceType = "ResourceType"
            case value = "Value"
        }
    }

    public struct TagsType: AWSDecodableShape {
        /// A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.
        public let nextToken: String?
        /// One or more tags.
        @OptionalCustomCoding<StandardArrayCoder>
        public var tags: [TagDescription]?

        public init(nextToken: String? = nil, tags: [TagDescription]? = nil) {
            self.nextToken = nextToken
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case tags = "Tags"
        }
    }

    public struct TargetTrackingConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// A customized metric. You must specify either a predefined metric or a customized metric.
        public let customizedMetricSpecification: CustomizedMetricSpecification?
        /// Indicates whether scaling in by the target tracking scaling policy is disabled. If scaling in is disabled, the target tracking scaling policy doesn't remove instances from the Auto Scaling group. Otherwise, the target tracking scaling policy can remove instances from the Auto Scaling group. The default is false.
        public let disableScaleIn: Bool?
        /// A predefined metric. You must specify either a predefined metric or a customized metric.
        public let predefinedMetricSpecification: PredefinedMetricSpecification?
        /// The target value for the metric.
        public let targetValue: Double

        public init(customizedMetricSpecification: CustomizedMetricSpecification? = nil, disableScaleIn: Bool? = nil, predefinedMetricSpecification: PredefinedMetricSpecification? = nil, targetValue: Double) {
            self.customizedMetricSpecification = customizedMetricSpecification
            self.disableScaleIn = disableScaleIn
            self.predefinedMetricSpecification = predefinedMetricSpecification
            self.targetValue = targetValue
        }

        public func validate(name: String) throws {
            try self.predefinedMetricSpecification?.validate(name: "\(name).predefinedMetricSpecification")
        }

        private enum CodingKeys: String, CodingKey {
            case customizedMetricSpecification = "CustomizedMetricSpecification"
            case disableScaleIn = "DisableScaleIn"
            case predefinedMetricSpecification = "PredefinedMetricSpecification"
            case targetValue = "TargetValue"
        }
    }

    public struct TerminateInstanceInAutoScalingGroupType: AWSEncodableShape {
        /// The ID of the instance.
        public let instanceId: String
        /// Indicates whether terminating the instance also decrements the size of the Auto Scaling group.
        public let shouldDecrementDesiredCapacity: Bool

        public init(instanceId: String, shouldDecrementDesiredCapacity: Bool) {
            self.instanceId = instanceId
            self.shouldDecrementDesiredCapacity = shouldDecrementDesiredCapacity
        }

        public func validate(name: String) throws {
            try self.validate(self.instanceId, name: "instanceId", parent: name, max: 19)
            try self.validate(self.instanceId, name: "instanceId", parent: name, min: 1)
            try self.validate(self.instanceId, name: "instanceId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case instanceId = "InstanceId"
            case shouldDecrementDesiredCapacity = "ShouldDecrementDesiredCapacity"
        }
    }

    public struct UpdateAutoScalingGroupType: AWSEncodableShape {
        /// The name of the Auto Scaling group.
        public let autoScalingGroupName: String
        /// One or more Availability Zones for the group.
        @OptionalCustomCoding<StandardArrayCoder>
        public var availabilityZones: [String]?
        /// Enables or disables Capacity Rebalancing. For more information, see Amazon EC2 Auto Scaling Capacity Rebalancing in the Amazon EC2 Auto Scaling User Guide.
        public let capacityRebalance: Bool?
        /// The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. The default value is 300. This setting applies when using simple scaling policies, but not when using other scaling policies or scheduled scaling. For more information, see Scaling cooldowns for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
        public let defaultCooldown: Int?
        /// The desired capacity is the initial capacity of the Auto Scaling group after this operation completes and the capacity it attempts to maintain. This number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.
        public let desiredCapacity: Int?
        /// The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service. The default value is 0. For more information, see Health check grace period in the Amazon EC2 Auto Scaling User Guide. Conditional: Required if you are adding an ELB health check.
        public let healthCheckGracePeriod: Int?
        /// The service to use for the health checks. The valid values are EC2 and ELB. If you configure an Auto Scaling group to use ELB health checks, it considers the instance unhealthy if it fails either the EC2 status checks or the load balancer health checks.
        public let healthCheckType: String?
        /// The name of the launch configuration. If you specify LaunchConfigurationName in your update request, you can't specify LaunchTemplate or MixedInstancesPolicy.
        public let launchConfigurationName: String?
        /// The launch template and version to use to specify the updates. If you specify LaunchTemplate in your update request, you can't specify LaunchConfigurationName or MixedInstancesPolicy.
        public let launchTemplate: LaunchTemplateSpecification?
        /// The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). To clear a previously set value, specify a new value of 0. For more information, see Replacing Auto Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide.
        public let maxInstanceLifetime: Int?
        /// The maximum size of the Auto Scaling group.  With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above MaxSize to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go above MaxSize by more than your largest instance weight (weights that define how many units each instance contributes to the desired capacity of the group).
        public let maxSize: Int?
        /// The minimum size of the Auto Scaling group.
        public let minSize: Int?
        /// An embedded object that specifies a mixed instances policy. When you make changes to an existing policy, all optional parameters are left unchanged if not specified. For more information, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide.
        public let mixedInstancesPolicy: MixedInstancesPolicy?
        /// Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in. For more information about preventing instances from terminating on scale in, see Instance scale-in protection in the Amazon EC2 Auto Scaling User Guide.
        public let newInstancesProtectedFromScaleIn: Bool?
        /// The name of an existing placement group into which to launch your instances, if any. A placement group is a logical grouping of instances within a single Availability Zone. You cannot specify multiple Availability Zones and a placement group. For more information, see Placement Groups in the Amazon EC2 User Guide for Linux Instances.
        public let placementGroup: String?
        /// The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS services on your behalf. For more information, see Service-linked roles in the Amazon EC2 Auto Scaling User Guide.
        public let serviceLinkedRoleARN: String?
        /// A policy or a list of policies that are used to select the instances to terminate. The policies are executed in the order that you list them. For more information, see Controlling which Auto Scaling instances terminate during scale in in the Amazon EC2 Auto Scaling User Guide.
        @OptionalCustomCoding<StandardArrayCoder>
        public var terminationPolicies: [String]?
        /// A comma-separated list of subnet IDs for a virtual private cloud (VPC). If you specify VPCZoneIdentifier with AvailabilityZones, the subnets that you specify for this parameter must reside in those Availability Zones.
        public let vPCZoneIdentifier: String?

        public init(autoScalingGroupName: String, availabilityZones: [String]? = nil, capacityRebalance: Bool? = nil, defaultCooldown: Int? = nil, desiredCapacity: Int? = nil, healthCheckGracePeriod: Int? = nil, healthCheckType: String? = nil, launchConfigurationName: String? = nil, launchTemplate: LaunchTemplateSpecification? = nil, maxInstanceLifetime: Int? = nil, maxSize: Int? = nil, minSize: Int? = nil, mixedInstancesPolicy: MixedInstancesPolicy? = nil, newInstancesProtectedFromScaleIn: Bool? = nil, placementGroup: String? = nil, serviceLinkedRoleARN: String? = nil, terminationPolicies: [String]? = nil, vPCZoneIdentifier: String? = nil) {
            self.autoScalingGroupName = autoScalingGroupName
            self.availabilityZones = availabilityZones
            self.capacityRebalance = capacityRebalance
            self.defaultCooldown = defaultCooldown
            self.desiredCapacity = desiredCapacity
            self.healthCheckGracePeriod = healthCheckGracePeriod
            self.healthCheckType = healthCheckType
            self.launchConfigurationName = launchConfigurationName
            self.launchTemplate = launchTemplate
            self.maxInstanceLifetime = maxInstanceLifetime
            self.maxSize = maxSize
            self.minSize = minSize
            self.mixedInstancesPolicy = mixedInstancesPolicy
            self.newInstancesProtectedFromScaleIn = newInstancesProtectedFromScaleIn
            self.placementGroup = placementGroup
            self.serviceLinkedRoleARN = serviceLinkedRoleARN
            self.terminationPolicies = terminationPolicies
            self.vPCZoneIdentifier = vPCZoneIdentifier
        }

        public func validate(name: String) throws {
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, max: 255)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, min: 1)
            try self.validate(self.autoScalingGroupName, name: "autoScalingGroupName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.availabilityZones?.forEach {
                try validate($0, name: "availabilityZones[]", parent: name, max: 255)
                try validate($0, name: "availabilityZones[]", parent: name, min: 1)
                try validate($0, name: "availabilityZones[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.healthCheckType, name: "healthCheckType", parent: name, max: 32)
            try self.validate(self.healthCheckType, name: "healthCheckType", parent: name, min: 1)
            try self.validate(self.healthCheckType, name: "healthCheckType", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.launchConfigurationName, name: "launchConfigurationName", parent: name, max: 255)
            try self.validate(self.launchConfigurationName, name: "launchConfigurationName", parent: name, min: 1)
            try self.validate(self.launchConfigurationName, name: "launchConfigurationName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.launchTemplate?.validate(name: "\(name).launchTemplate")
            try self.mixedInstancesPolicy?.validate(name: "\(name).mixedInstancesPolicy")
            try self.validate(self.placementGroup, name: "placementGroup", parent: name, max: 255)
            try self.validate(self.placementGroup, name: "placementGroup", parent: name, min: 1)
            try self.validate(self.placementGroup, name: "placementGroup", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.validate(self.serviceLinkedRoleARN, name: "serviceLinkedRoleARN", parent: name, max: 1600)
            try self.validate(self.serviceLinkedRoleARN, name: "serviceLinkedRoleARN", parent: name, min: 1)
            try self.validate(self.serviceLinkedRoleARN, name: "serviceLinkedRoleARN", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            try self.terminationPolicies?.forEach {
                try validate($0, name: "terminationPolicies[]", parent: name, max: 1600)
                try validate($0, name: "terminationPolicies[]", parent: name, min: 1)
                try validate($0, name: "terminationPolicies[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
            }
            try self.validate(self.vPCZoneIdentifier, name: "vPCZoneIdentifier", parent: name, max: 2047)
            try self.validate(self.vPCZoneIdentifier, name: "vPCZoneIdentifier", parent: name, min: 1)
            try self.validate(self.vPCZoneIdentifier, name: "vPCZoneIdentifier", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case autoScalingGroupName = "AutoScalingGroupName"
            case availabilityZones = "AvailabilityZones"
            case capacityRebalance = "CapacityRebalance"
            case defaultCooldown = "DefaultCooldown"
            case desiredCapacity = "DesiredCapacity"
            case healthCheckGracePeriod = "HealthCheckGracePeriod"
            case healthCheckType = "HealthCheckType"
            case launchConfigurationName = "LaunchConfigurationName"
            case launchTemplate = "LaunchTemplate"
            case maxInstanceLifetime = "MaxInstanceLifetime"
            case maxSize = "MaxSize"
            case minSize = "MinSize"
            case mixedInstancesPolicy = "MixedInstancesPolicy"
            case newInstancesProtectedFromScaleIn = "NewInstancesProtectedFromScaleIn"
            case placementGroup = "PlacementGroup"
            case serviceLinkedRoleARN = "ServiceLinkedRoleARN"
            case terminationPolicies = "TerminationPolicies"
            case vPCZoneIdentifier = "VPCZoneIdentifier"
        }
    }
}
